How do you know if your ListView has enough number of items so that it can scroll?
For instance, If I have 5 items on my ListView all of it will be displayed on a si
AbsListView includes this:
/**
* Check if the items in the list can be scrolled in a certain direction.
*
* @param direction Negative to check scrolling up, positive to check scrolling down.
* @return true if the list can be scrolled in the specified direction, false otherwise.
* @see #scrollListBy(int)
*/
public boolean canScrollList(int direction);
You need to override layoutChildren() and use it within that:
@Override
protected void layoutChildren() {
super.layoutChildren();
isAtBottom = !canScrollList(1);
isAtTop = !canScrollList(-1);
}