HorizontalVariableListView icon indicating copy to clipboard operation
HorizontalVariableListView copied to clipboard

Filter items in list

Open MorfeuX opened this issue 12 years ago • 1 comments

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.

MorfeuX avatar Jun 30 '13 13:06 MorfeuX

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;
}

Alexey-Matjuk avatar Jul 29 '13 16:07 Alexey-Matjuk