DevsmartLib-Android
DevsmartLib-Android copied to clipboard
HorizontalListView improvements
- 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
I can confirm that this commit does all that it describes. I'm using it now, and it works great.
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)