DevsmartLib-Android icon indicating copy to clipboard operation
DevsmartLib-Android copied to clipboard

HorizontalListView improvements

Open MasterMeyer opened this issue 12 years ago • 2 comments

  • added possibility to snap to center
  • added possibility to endless scroll in a circle
  • performance optimization: no use of requestLayout to redraw the view for scrolling - since i used the view deep in some view hierarchy and it lead to problems
  • added some comments
  • implemented the setSelection method to center the selected View number
  • added getSelected... methods which return the centered View / index

MasterMeyer avatar May 08 '13 11:05 MasterMeyer

I can confirm that this commit does all that it describes. I'm using it now, and it works great.

kenticus avatar Feb 20 '14 16:02 kenticus

I want to be able to implement snap to center. The original code works, but I get a null pointer exception error when implementing this updated code...

FATAL EXCEPTION: main java.lang.NullPointerException com.devsmart.android.ui.HorizontalListViewWithSnap.setSelection(HorizontalListView.java:248) com.devsmart.android.ui.HorizontalListView.onSizeChanged(HorizontalListViewWithSnap.java:145)

waynem81 avatar May 07 '14 21:05 waynem81