mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Even smoother feed list scrolling.
This commit is contained in:
parent
70ba93c191
commit
9417d7e3ee
1 changed files with 6 additions and 1 deletions
|
@ -34,6 +34,7 @@ public class Main extends NbActivity implements StateChangedListener, SwipeRefre
|
|||
private TextView overlayStatusText;
|
||||
private boolean isLightTheme;
|
||||
private SwipeRefreshLayout swipeLayout;
|
||||
private boolean wasSwipeEnabled = false;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -168,7 +169,11 @@ public class Main extends NbActivity implements StateChangedListener, SwipeRefre
|
|||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
if (swipeLayout != null) {
|
||||
swipeLayout.setEnabled(firstVisibleItem == 0);
|
||||
boolean enable = (firstVisibleItem == 0);
|
||||
if (wasSwipeEnabled != enable) {
|
||||
swipeLayout.setEnabled(enable);
|
||||
wasSwipeEnabled = enable;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue