Beispiel #1
0
 public void onJustify() {
   if (Math.abs(scrollingOffset) > WheelScroller.MIN_DELTA_FOR_SCROLLING) {
     scroller.scroll(scrollingOffset, 0);
   }
 }
Beispiel #2
0
 /**
  * Scroll the wheel
  *
  * @param itemsToSkip items to scroll
  * @param time scrolling duration
  */
 public void scroll(int itemsToScroll, int time) {
   int distance = itemsToScroll * getItemHeight() - scrollingOffset;
   scroller.scroll(distance, time);
 }
 /**
  * Scroll the spinnerwheel
  *
  * @param itemsToScroll items to scroll
  * @param time scrolling duration
  */
 public void scroll(int itemsToScroll, int time) {
   int distance = itemsToScroll * getItemDimension() - mScrollingOffset;
   onScrollTouched(); // we have to emulate touch when scrolling spinnerwheel programmatically to
                      // light up stuff
   mScroller.scroll(distance, time);
 }