aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2015-04-08 13:32:03 +0200
committeriNPUTmice <daniel@gultsch.de>2015-04-08 13:32:03 +0200
commitc3a6d5d1d00a9b0b0c0e638e6ef04cd4fc25da3c (patch)
tree2dd67e0f7641d437128f7ba12ee145cbaf7baf4c
parent813530145e46175ada62e71715f6e788d741d6bb (diff)
modified / simplified maintain scroll position codeBrianBlade-feature/swipe_out_conversation
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 79b2c5c9..eaed4e02 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -189,14 +189,13 @@ public class ConversationActivity extends XmppActivity
final int index = listView.getFirstVisiblePosition();
View v = listView.getChildAt(0);
+ final int top = (v == null) ? 0 : (v.getTop() - listView.getPaddingTop());
swipedConversation = listAdapter.getItem(position);
listAdapter.remove(swipedConversation);
swipedConversation.markRead();
xmppConnectionService.getNotificationService().clear(swipedConversation);
- final int top = (v == null) ? 0 : (v.getTop() - listView.getPaddingTop());
-
if (position == 0 && listAdapter.getCount() == 0) {
endConversation(swipedConversation, false, true);
return null;
@@ -221,8 +220,8 @@ public class ConversationActivity extends XmppActivity
.reInit(getSelectedConversation());
}
swipedConversation = null;
+ listAdapter.notifyDataSetChanged();
listView.setSelectionFromTop(index + (listView.getChildCount() < position ? 1 : 0), top);
-
}
@Override