aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-12 20:11:16 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-12 20:11:16 +0200
commit681511379f85b3b01cf548bfb7493c8283e2072d (patch)
treef4b7a54f942bf54d01b7357cf4b5411016d0ea6f /src/main/java/de/pixart
parent477312ec289cf6e8afdd21cb5e56eec2d5215131 (diff)
fix jump to first unread message
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java77
1 files changed, 38 insertions, 39 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index e34bebcec..2c8d72aa0 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -2052,11 +2052,11 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
if (this.reInit(conversation, extras != null)) {
if (extras != null) {
processExtras(extras);
- this.reInitRequiredOnStart = false;
- } else {
- this.reInitRequiredOnStart = true;
- pendingExtras.push(extras);
}
+ this.reInitRequiredOnStart = false;
+ } else {
+ this.reInitRequiredOnStart = true;
+ pendingExtras.push(extras);
}
}
@@ -2103,7 +2103,6 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
final int bottom = Math.max(0, this.messageList.size() - 1);
final int pos;
if (first == null) {
- Log.d(Config.LOGTAG, "first unread message was null");
pos = bottom;
} else {
int i = getIndexOf(first.getUuid(), this.messageList);
@@ -2113,48 +2112,48 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
}
+ activity.onConversationRead(this.conversation);
+ //TODO if we only do this when this fragment is running on main it won't *bing* in tablet layout which might be unnecessary since we can *see* it
+ activity.xmppConnectionService.getNotificationService().setOpenConversation(this.conversation);
+
gesturesDetector.setOnFingerGestureListener(new SimpleFingerGestures.OnFingerGestureListener() {
- @Override
- public boolean onSwipeUp(int fingers, long gestureDuration, double gestureDistance) {
- return false;
- }
+ @Override
+ public boolean onSwipeUp(int fingers, long gestureDuration, double gestureDistance) {
+ return false;
+ }
- @Override
- public boolean onSwipeDown(int fingers, long gestureDuration, double gestureDistance) {
- return false;
- }
+ @Override
+ public boolean onSwipeDown(int fingers, long gestureDuration, double gestureDistance) {
+ return false;
+ }
- @Override
- public boolean onSwipeLeft(int fingers, long gestureDuration, double gestureDistance) {
- return false;
- }
+ @Override
+ public boolean onSwipeLeft(int fingers, long gestureDuration, double gestureDistance) {
+ return false;
+ }
- @Override
- public boolean onSwipeRight(int fingers, long gestureDuration, double gestureDistance) {
- activity.onBackPressed();
- return false;
- }
+ @Override
+ public boolean onSwipeRight(int fingers, long gestureDuration, double gestureDistance) {
+ activity.onBackPressed();
+ return false;
+ }
- @Override
- public boolean onPinch(int fingers, long gestureDuration, double gestureDistance) {
- return false;
- }
+ @Override
+ public boolean onPinch(int fingers, long gestureDuration, double gestureDistance) {
+ return false;
+ }
- @Override
- public boolean onUnpinch(int fingers, long gestureDuration, double gestureDistance) {
- return false;
- }
+ @Override
+ public boolean onUnpinch(int fingers, long gestureDuration, double gestureDistance) {
+ return false;
+ }
- @Override
- public boolean onDoubleTap(int fingers) {
- return false;
- }
- });
+ @Override
+ public boolean onDoubleTap(int fingers) {
+ return false;
+ }
+ });
this.binding.messagesView.setOnTouchListener(gesturesDetector);
-
- activity.onConversationRead(this.conversation);
- //TODO if we only do this when this fragment is running on main it won't *bing* in tablet layout which might be unnecessary since we can *see* it
- activity.xmppConnectionService.getNotificationService().setOpenConversation(this.conversation);
return true;
}