|
|
|
@ -3186,14 +3186,12 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
|
if (handleThreadActions(messages))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (viewType == AdapterMessage.ViewType.THREAD)
|
|
|
|
|
adapter.gotoTop();
|
|
|
|
|
else if (viewType != AdapterMessage.ViewType.SEARCH) {
|
|
|
|
|
if (viewType != AdapterMessage.ViewType.SEARCH) {
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
|
boolean autoscroll = prefs.getBoolean("autoscroll", true);
|
|
|
|
|
if (autoscroll) {
|
|
|
|
|
|
|
|
|
|
boolean gotoTop = false;
|
|
|
|
|
for (int i = 0; i < messages.size(); i++) {
|
|
|
|
|
for (int i = 0; i < messages.size() && i < ViewModelMessages.LOCAL_PAGE_SIZE; i++) {
|
|
|
|
|
TupleMessageEx message = messages.get(i);
|
|
|
|
|
if (message != null && !ids.contains(message.id)) {
|
|
|
|
|
ids.add(message.id);
|
|
|
|
@ -3202,10 +3200,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gotoTop)
|
|
|
|
|
if (gotoTop &&
|
|
|
|
|
(autoscroll || viewType == AdapterMessage.ViewType.THREAD))
|
|
|
|
|
adapter.gotoTop();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Log.i("Submit messages=" + messages.size());
|
|
|
|
|
adapter.submitList(messages);
|
|
|
|
|