From 143ad48be1970f1d71445c7698d9011c64ce1b3f Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 20 Jan 2017 10:43:50 +0100 Subject: don't prematurly mark conversation as read during activity start. fixes #2245 --- src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 871fa604..9b6f1dbd 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -99,6 +99,7 @@ public class ConversationActivity extends XmppActivity private String mOpenConversation = null; private boolean mPanelOpen = true; + private AtomicBoolean mShouldPanelBeOpen = new AtomicBoolean(false); private Pair mScrollPosition = null; final private List mPendingImageUris = new ArrayList<>(); final private List mPendingFileUris = new ArrayList<>(); @@ -134,6 +135,7 @@ public class ConversationActivity extends XmppActivity public void showConversationsOverview() { if (mContentView instanceof SlidingPaneLayout) { SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView; + mShouldPanelBeOpen.set(true); mSlidingPaneLayout.openPane(); } } @@ -151,6 +153,7 @@ public class ConversationActivity extends XmppActivity public void hideConversationsOverview() { if (mContentView instanceof SlidingPaneLayout) { SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView; + mShouldPanelBeOpen.set(false); mSlidingPaneLayout.closePane(); } } @@ -161,8 +164,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; } @@ -1129,6 +1131,7 @@ public class ConversationActivity extends XmppActivity if (!isConversationsOverviewVisable() || !isConversationsOverviewHideable()) { + Conversation c = getSelectedConversation(); sendReadMarkerIfNecessary(getSelectedConversation()); } -- cgit v1.2.3