Removed scroll to top for threads

pull/168/head
M66B 5 years ago
parent 40a6b1f334
commit 83bbc659e2

@ -3188,35 +3188,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
};
private Observer<PagedList<TupleMessageEx>> observer = new Observer<PagedList<TupleMessageEx>>() {
private List<Long> ids = new ArrayList<>();
@Override
public void onChanged(@Nullable PagedList<TupleMessageEx> messages) {
if (messages == null)
return;
if (viewType == AdapterMessage.ViewType.THREAD) {
if (viewType == AdapterMessage.ViewType.THREAD)
if (handleThreadActions(messages))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean autoscroll = prefs.getBoolean("autoscroll", true);
if (autoscroll) {
boolean gotoTop = false;
for (int i = 0; i < messages.size(); i++) {
TupleMessageEx message = messages.get(i);
if (message != null && !ids.contains(message.id)) {
ids.add(message.id);
if (!message.ui_seen && !message.duplicate)
gotoTop = true;
}
}
if (gotoTop)
adapter.gotoTop();
}
}
Log.i("Submit messages=" + messages.size());
adapter.submitList(messages);

Loading…
Cancel
Save