aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-01-21 12:14:08 +0100
committerChristian Schneppe <christian@pix-art.de>2017-01-21 12:14:08 +0100
commit82bd7e17f10fad1979659db10dbf5b6b3a62abb1 (patch)
treee114df689305f64b24e35df5d9443850692934ce /src/main/java/de/pixart
parentb6c74036539b4ab52d8a0653b838e6c54aef96ee (diff)
don't prematurly mark conversation as read during activity start
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index 343d4f3ce..639baa893 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -120,6 +120,7 @@ public class ConversationActivity extends XmppActivity
final private List<Uri> mPendingVideoUris = new ArrayList<>();
private String mOpenConversation = null;
private boolean mPanelOpen = true;
+ private AtomicBoolean mShouldPanelBeOpen = new AtomicBoolean(false);
private Pair<Integer, Integer> mScrollPosition = null;
private Uri mPendingGeoUri = null;
private boolean forbidProcessingPendings = false;
@@ -155,6 +156,7 @@ public class ConversationActivity extends XmppActivity
public void showConversationsOverview() {
if (mContentView instanceof SlidingPaneLayout) {
SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView;
+ mShouldPanelBeOpen.set(true);
mSlidingPaneLayout.openPane();
}
}
@@ -172,6 +174,7 @@ public class ConversationActivity extends XmppActivity
public void hideConversationsOverview() {
if (mContentView instanceof SlidingPaneLayout) {
SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView;
+ mShouldPanelBeOpen.set(false);
mSlidingPaneLayout.closePane();
}
}
@@ -186,8 +189,7 @@ public class ConversationActivity extends XmppActivity
public boolean isConversationsOverviewVisable() {
if (mContentView instanceof SlidingPaneLayout) {
- SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView;
- return mSlidingPaneLayout.isOpen();
+ return mShouldPanelBeOpen.get();
} else {
return true;
}
@@ -334,18 +336,19 @@ public class ConversationActivity extends XmppActivity
@Override
public void onPanelOpened(View arg0) {
+ mShouldPanelBeOpen.set(true);
updateActionBarTitle();
invalidateOptionsMenu();
hideKeyboard();
if (xmppConnectionServiceBound) {
- xmppConnectionService.getNotificationService()
- .setOpenConversation(null);
+ xmppConnectionService.getNotificationService().setOpenConversation(null);
}
closeContextMenu();
}
@Override
public void onPanelClosed(View arg0) {
+ mShouldPanelBeOpen.set(false);
listView.discardUndo();
openConversation();
}
@@ -1525,6 +1528,9 @@ public class ConversationActivity extends XmppActivity
if (!ExceptionHelper.checkForCrash(this, this.xmppConnectionService)) {
openBatteryOptimizationDialogIfNeeded();
}
+ if (isConversationsOverviewVisable() && isConversationsOverviewHideable()) {
+ xmppConnectionService.getNotificationService().setOpenConversation(null);
+ }
}
private void handleViewConversationIntent(final Intent intent) {