List of usage examples for android.widget ListView getListPaddingLeft
public int getListPaddingLeft()
From source file:Main.java
public static boolean canScrollList(final ListView lv, int direction) { final int childCount = lv.getChildCount(); if (childCount == 0) { return false; }/*from www . ja v a2 s. co m*/ final int firstPosition = lv.getFirstVisiblePosition(); final Rect listPadding = new Rect(lv.getListPaddingLeft(), lv.getListPaddingTop(), lv.getListPaddingRight(), lv.getListPaddingBottom()); if (direction > 0) { final int lastBottom = lv.getChildAt(childCount - 1).getBottom(); final int lastPosition = firstPosition + childCount; return lastPosition < lv.getCount() || lastBottom > lv.getHeight() - listPadding.bottom; } else { final int firstTop = lv.getChildAt(0).getTop(); return firstPosition > 0 || firstTop < listPadding.top; } }