From a90a8f9fefbe48d10e397efb5c363e8ee36070b0 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 3 Nov 2017 11:38:11 +0100 Subject: [PATCH] Fixed wait layout of GroupChatInfo fragment + added the same of ChatCreationFragment --- res/layout/chat_create.xml | 339 ++++++++++-------- .../linphone/chat/ChatCreationFragment.java | 8 +- .../org/linphone/chat/GroupInfoFragment.java | 3 +- 3 files changed, 191 insertions(+), 159 deletions(-) diff --git a/res/layout/chat_create.xml b/res/layout/chat_create.xml index 9d548bd5c..bbaa58fa7 100644 --- a/res/layout/chat_create.xml +++ b/res/layout/chat_create.xml @@ -1,182 +1,207 @@ - + android:layout_height="match_parent"> - + - + - + - + - - + - + + - + - - + - + + - + - + - + - + - + - + - - + - + + - + - + - + - + - + - \ No newline at end of file + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/android/org/linphone/chat/ChatCreationFragment.java b/src/android/org/linphone/chat/ChatCreationFragment.java index d2de756e7..d356a4b7a 100644 --- a/src/android/org/linphone/chat/ChatCreationFragment.java +++ b/src/android/org/linphone/chat/ChatCreationFragment.java @@ -60,7 +60,7 @@ public class ChatCreationFragment extends Fragment implements View.OnClickListen private ImageView allContacts, linphoneContacts; private boolean onlyDisplayLinphoneContacts; private View allContactsSelected, linphoneContactsSelected; - private RelativeLayout searchLayout; + private RelativeLayout searchLayout, waitLayout; private ImageView clearSearchField; private EditText searchField; private ProgressBar contactsFetchInProgress; @@ -78,6 +78,9 @@ public class ChatCreationFragment extends Fragment implements View.OnClickListen contactsSelected = new ArrayList<>(); } + waitLayout = view.findViewById(R.id.waitScreen); + waitLayout.setVisibility(View.GONE); + contactsList = view.findViewById(R.id.contactsList); contactsSelectedLayout = view.findViewById(R.id.contactsSelected); contactsSelectLayout = view.findViewById(R.id.layoutContactsSelected); @@ -282,6 +285,7 @@ public class ChatCreationFragment extends Fragment implements View.OnClickListen } else if (id == R.id.next) { if (contactsSelected.size() == 1) { contactsSelectedLayout.removeAllViews(); + waitLayout.setVisibility(View.VISIBLE); //LinphoneActivity.instance().displayChat(contactsSelected.get(0).getAddress(), "", ""); //TODO create group chat room with only two participants ? //TODO what subject to set ? @@ -290,8 +294,10 @@ public class ChatCreationFragment extends Fragment implements View.OnClickListen @Override public void onStateChanged(ChatRoom cr, ChatRoom.State newState) { if (newState == ChatRoom.State.Created) { + waitLayout.setVisibility(View.GONE); LinphoneActivity.instance().goToChat(cr.getConferenceAddress().asStringUriOnly()); } else if (newState == ChatRoom.State.CreationFailed) { + waitLayout.setVisibility(View.GONE); //TODO display error Log.e("Group chat room for address " + cr.getConferenceAddress() + " has failed !"); } diff --git a/src/android/org/linphone/chat/GroupInfoFragment.java b/src/android/org/linphone/chat/GroupInfoFragment.java index 1e3db6dc3..115aac526 100644 --- a/src/android/org/linphone/chat/GroupInfoFragment.java +++ b/src/android/org/linphone/chat/GroupInfoFragment.java @@ -142,10 +142,11 @@ public class GroupInfoFragment extends Fragment { chatRoom.setListener(new ChatRoomListenerStub() { @Override public void onStateChanged(ChatRoom cr, ChatRoom.State newState) { - mWaitLayout.setVisibility(View.GONE); if (newState == ChatRoom.State.Created) { + mWaitLayout.setVisibility(View.GONE); LinphoneActivity.instance().goToChat(cr.getConferenceAddress().asStringUriOnly()); } else if (newState == ChatRoom.State.CreationFailed) { + mWaitLayout.setVisibility(View.GONE); //TODO display error Log.e("Group chat room for address " + cr.getConferenceAddress() + " has failed !"); }