Save the offset of the list position top item

multisite
Floens 10 years ago
parent a167cf7703
commit 413e025fb8
  1. 6
      Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadListLayout.java

@ -100,9 +100,11 @@ public class ThreadListLayout extends LinearLayout implements ReplyLayout.ReplyL
// onScrolled can be called after cleanup()
if (showingThread != null) {
int index = Math.max(0, getTopAdapterPosition());
// int top = recyclerView.getLayoutManager().getChildAt(0).getTop();
View topChild = recyclerView.getLayoutManager().getChildAt(0);
int top = topChild == null ? 0 : topChild.getTop();
showingThread.loadable.listViewIndex = index;
// showingThread.loadable.listViewTop = top;
showingThread.loadable.listViewTop = top;
int last = getCompleteBottomAdapterPosition();
if (last == postAdapter.getUnfilteredDisplaySize() - 1 && last > lastPostCount) {

Loading…
Cancel
Save