Fix pull to refresh for the cards view

filtering
Floens 10 years ago
parent 653e2cfe08
commit 2446f44ade
  1. 14
      Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadListLayout.java

@ -264,22 +264,20 @@ public class ThreadListLayout extends LinearLayout implements ReplyLayout.ReplyL
return true; return true;
} }
View top = recyclerView.getChildAt(0);
if (top != null) {
switch (postViewMode) { switch (postViewMode) {
case LIST: case LIST:
if (top.getTop() == 0 && ((LinearLayoutManager) layoutManager).findFirstVisibleItemPosition() == 0) { if (((LinearLayoutManager) layoutManager).findFirstVisibleItemPosition() == 0) {
return false; View top = layoutManager.findViewByPosition(0);
return top.getTop() != 0;
} }
break; break;
case CARD: case CARD:
if (top.getTop() == 0 && ((GridLayoutManager) layoutManager).findFirstVisibleItemPosition() == 0) { if (((GridLayoutManager) layoutManager).findFirstVisibleItemPosition() == 0) {
return false; View top = layoutManager.findViewByPosition(0);
return top.getTop() != dp(8); // 4dp for the cards, 4dp for this layout
} }
break; break;
} }
}
return true; return true;
} }

Loading…
Cancel
Save