Fixed back button on chat room group info during creation process
This commit is contained in:
parent
71efda66ce
commit
eca542ae28
3 changed files with 28 additions and 25 deletions
|
@ -20,6 +20,7 @@
|
|||
package org.linphone.chat;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
@ -258,7 +259,18 @@ public class ChatActivity extends MainActivity {
|
|||
ArrayList<ContactAddress> participants,
|
||||
String subject,
|
||||
boolean encrypted,
|
||||
boolean isGroupChatRoom) {
|
||||
boolean isGroupChatRoom,
|
||||
boolean cleanBackStack) {
|
||||
if (cleanBackStack) {
|
||||
FragmentManager fm = getFragmentManager();
|
||||
while (fm.getBackStackEntryCount() > 0) {
|
||||
fm.popBackStackImmediate();
|
||||
}
|
||||
if (isTablet()) {
|
||||
showEmptyChildFragment();
|
||||
}
|
||||
}
|
||||
|
||||
Bundle extras = new Bundle();
|
||||
if (peerAddress != null) {
|
||||
extras.putSerializable("RemoteSipUri", peerAddress.asStringUriOnly());
|
||||
|
|
|
@ -108,7 +108,7 @@ public class ChatRoomsFragment extends Fragment
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
((ChatActivity) getActivity())
|
||||
.showChatRoomCreation(null, null, null, false, false);
|
||||
.showChatRoomCreation(null, null, null, false, false, false);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -117,7 +117,7 @@ public class ChatRoomsFragment extends Fragment
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
((ChatActivity) getActivity())
|
||||
.showChatRoomCreation(null, null, null, false, true);
|
||||
.showChatRoomCreation(null, null, null, false, true, false);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import static android.content.Context.INPUT_METHOD_SERVICE;
|
|||
|
||||
import android.app.Dialog;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -146,7 +145,11 @@ public class GroupInfoFragment extends Fragment {
|
|||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
((ChatActivity) getActivity()).goBack();
|
||||
if (mIsAlreadyCreatedGroup) {
|
||||
((ChatActivity) getActivity()).goBack();
|
||||
} else {
|
||||
goBackToChatCreationFragment();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -300,26 +303,14 @@ public class GroupInfoFragment extends Fragment {
|
|||
}
|
||||
|
||||
private void goBackToChatCreationFragment() {
|
||||
boolean previousFragmentInBackStackIsChatRoomCreation = false;
|
||||
FragmentManager fragmentManager = getActivity().getFragmentManager();
|
||||
int count = fragmentManager.getBackStackEntryCount();
|
||||
if (count > 1) {
|
||||
FragmentManager.BackStackEntry entry = fragmentManager.getBackStackEntryAt(count - 1);
|
||||
if ("Chat room creation".equals(entry.getName())) {
|
||||
previousFragmentInBackStackIsChatRoomCreation = true;
|
||||
((ChatActivity) getActivity()).goBack();
|
||||
}
|
||||
}
|
||||
|
||||
if (!previousFragmentInBackStackIsChatRoomCreation) {
|
||||
((ChatActivity) getActivity())
|
||||
.showChatRoomCreation(
|
||||
mGroupChatRoomAddress,
|
||||
mParticipants,
|
||||
mSubject,
|
||||
mIsEncryptionEnabled,
|
||||
true);
|
||||
}
|
||||
((ChatActivity) getActivity())
|
||||
.showChatRoomCreation(
|
||||
mGroupChatRoomAddress,
|
||||
mParticipants,
|
||||
mSubject,
|
||||
mIsEncryptionEnabled,
|
||||
true,
|
||||
!mIsAlreadyCreatedGroup);
|
||||
}
|
||||
|
||||
private void refreshParticipantsList() {
|
||||
|
|
Loading…
Reference in a new issue