mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Reset scroll position after switching account (#4451)
This commit is contained in:
@@ -717,6 +717,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||
refreshAvatar();
|
||||
refreshUnreadIndicator();
|
||||
refreshTitle();
|
||||
conversationListFragment.resetScrollPosition();
|
||||
conversationListFragment.loadChatlistAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ public class ConversationListFragment extends BaseConversationListFragment
|
||||
private Timer reloadTimer;
|
||||
private boolean chatlistJustLoaded;
|
||||
private boolean reloadTimerInstantly;
|
||||
private boolean resetScrollPosition;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
@@ -303,6 +304,11 @@ public class ConversationListFragment extends BaseConversationListFragment
|
||||
}
|
||||
|
||||
((ConversationListAdapter) list.getAdapter()).changeData(chatlist);
|
||||
|
||||
if (resetScrollPosition) {
|
||||
list.scrollToPosition(0);
|
||||
resetScrollPosition = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -359,4 +365,8 @@ public class ConversationListFragment extends BaseConversationListFragment
|
||||
loadChatlistAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public void resetScrollPosition() {
|
||||
resetScrollPosition = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user