Merge "Don't auto scroll empty lists"
This commit is contained in:
committed by
Android (Google) Code Review
commit
012785d8cb
@@ -892,6 +892,10 @@ public abstract class AutoScrollHelper implements View.OnTouchListener {
|
||||
public boolean canTargetScrollVertically(int direction) {
|
||||
final AbsListView target = mTarget;
|
||||
final int itemCount = target.getCount();
|
||||
if (itemCount == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final int childCount = target.getChildCount();
|
||||
final int firstPosition = target.getFirstVisiblePosition();
|
||||
final int lastPosition = firstPosition + childCount;
|
||||
|
||||
Reference in New Issue
Block a user