Partly fix rotation issues

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-12-12 16:54:23 +01:00
parent 7ff6fcd366
commit d461afb25b
2 changed files with 20 additions and 18 deletions

View file

@ -503,9 +503,9 @@ public class ChatController extends BaseController implements MessagesListAdapte
new KeyboardUtils(getActivity(), getView(), false);
}
if (inChat) {
NotificationUtils.cancelExistingNotifications(getApplicationContext(), conversationUser);
NotificationUtils.cancelExistingNotifications(getApplicationContext(), conversationUser);
if (inChat) {
if (wasDetached & conversationUser.hasSpreedCapabilityWithName("no-ping")) {
wasDetached = false;
joinRoomWithPassword();
@ -516,7 +516,8 @@ public class ChatController extends BaseController implements MessagesListAdapte
@Override
protected void onDetach(@NonNull View view) {
super.onDetach(view);
if (conversationUser.hasSpreedCapabilityWithName("no-ping")) {
if (conversationUser.hasSpreedCapabilityWithName("no-ping")
&& getActivity() != null && !getActivity().isChangingConfigurations()) {
wasDetached = true;
leaveRoom();
}
@ -538,7 +539,6 @@ public class ChatController extends BaseController implements MessagesListAdapte
adapter = null;
inChat = false;
ApplicationWideCurrentRoomHolder.getInstance().clear();
leaveRoom();
}
private void dispose() {

View file

@ -200,7 +200,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
if (isNewConversationView) {
toggleNewCallHeaderVisibility(!isPublicCall);
checkAndHandleDoneMenuItem();
}
@ -608,18 +607,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
if (swipeRefreshLayout != null) {
swipeRefreshLayout.setRefreshing(false);
}
progressBar.setVisibility(View.GONE);
genericRvLayout.setVisibility(View.VISIBLE);
if (isNewConversationView) {
conversationPrivacyToogleLayout.setVisibility(View.VISIBLE);
joinConversationViaLinkLayout.setVisibility(View.VISIBLE);
}
if (isNewConversationView) {
checkAndHandleDoneMenuItem();
}
}
}
@ -660,6 +647,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
dispose(contactsQueryDisposable);
alreadyFetching = false;
disengageProgressBar();
}
});
@ -686,6 +674,21 @@ public class ContactsController extends BaseController implements SearchView.OnQ
return "";
}
});
disengageProgressBar();
}
private void disengageProgressBar() {
if (!alreadyFetching) {
progressBar.setVisibility(View.GONE);
genericRvLayout.setVisibility(View.VISIBLE);
if (isNewConversationView) {
conversationPrivacyToogleLayout.setVisibility(View.VISIBLE);
joinConversationViaLinkLayout.setVisibility(View.VISIBLE);
checkAndHandleDoneMenuItem();
}
}
}
private void dispose(@Nullable Disposable disposable) {
@ -766,7 +769,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
if (!doneMenuItem.isVisible()) {
doneMenuItem.setVisible(true);
}
} else {
doneMenuItem.setVisible(false);
}