Skip to content

Instantly share code, notes, and snippets.

@sharoni474
sharoni474 / ExpendingListView
Created June 21, 2014 15:16
A fix for Daniel Olshansky's DevByte example "ListView Expanding Cells Animation"- collapsing part, when last item is visible from top
int offset = computeVerticalScrollOffset();
int range = computeVerticalScrollRange();
int extent = computeVerticalScrollExtent();
int leftoverExtent = range - offset - extent;
// In Case Items does not fill the screen (More accurate, if last
// Item is reachable from offset 0
boolean isfillingScreen = getBottom() - height +yDelta< getHeight();
// added line