HorizontalVariableListView
HorizontalVariableListView copied to clipboard
Filter items in list
Hello,
I have a problem filtering the list. If for example I have a 200 elements list and I filter it to 10 notifying the adapter all works well only that when fling to the end of the list it scroll way over the end of the list in white space.
Thank you.
Try this solution:
IFlingRunnable:
Add int updateX(int x); in FlingRunnableView interface
Change int x = getCurrX(); line with int x = mParent.updateX(getCurrX());
Add to HorizontalVariableListView:
@Override
public int updateX(int x) {
int maxX = Integer.MAX_VALUE;;
if (mRightViewIndex == mAdapterItemCount) {
int rightEdge = Integer.MAX_VALUE;
int realWidth = getWidth();
View child = getChildAt(getChildCount() - 1);
if (child != null)
rightEdge = child.getRight();
if (rightEdge > realWidth)
maxX = rightEdge - realWidth;
else
maxX = 0;
}
if (x > maxX)
return maxX;
return x;
}