Fix onListScrolledToBottom not working when items were removed.

Not sure why I had getUnfilteredDisplaySize and why it was only used for scrolled to bottom.
multisite
Floens 9 years ago
parent ead60493a6
commit d50508268e
  1. 14
      Clover/app/src/main/java/org/floens/chan/ui/adapter/PostAdapter.java
  2. 2
      Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadListLayout.java

@ -131,20 +131,6 @@ public class PostAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
return size; return size;
} }
public int getUnfilteredDisplaySize() {
int size = sourceList.size();
if (showStatusView()) {
size++;
}
if (lastSeenIndicatorPosition >= 0) {
size++;
}
return size;
}
@Override @Override
public int getItemViewType(int position) { public int getItemViewType(int position) {
if (position == lastSeenIndicatorPosition) { if (position == lastSeenIndicatorPosition) {

@ -113,7 +113,7 @@ public class ThreadListLayout extends FrameLayout implements ReplyLayout.ReplyLa
showingThread.loadable.setListViewTop(indexTop[1]); showingThread.loadable.setListViewTop(indexTop[1]);
int last = getCompleteBottomAdapterPosition(); int last = getCompleteBottomAdapterPosition();
if (last == postAdapter.getUnfilteredDisplaySize() - 1 && last > lastPostCount) { if (last == postAdapter.getItemCount() - 1 && last > lastPostCount) {
lastPostCount = last; lastPostCount = last;
ThreadListLayout.this.callback.onListScrolledToBottom(); ThreadListLayout.this.callback.onListScrolledToBottom();
} }

Loading…
Cancel
Save