List of usage examples for android.widget Scroller getFinalY
public final int getFinalY()
From source file:org.telegram.ui.Components.NumberPicker.java
private boolean moveToFinalScrollerPosition(Scroller scroller) { scroller.forceFinished(true);//from w ww .ja va 2 s .c o m int amountToScroll = scroller.getFinalY() - scroller.getCurrY(); int futureScrollOffset = (mCurrentScrollOffset + amountToScroll) % mSelectorElementHeight; int overshootAdjustment = mInitialScrollOffset - futureScrollOffset; if (overshootAdjustment != 0) { if (Math.abs(overshootAdjustment) > mSelectorElementHeight / 2) { if (overshootAdjustment > 0) { overshootAdjustment -= mSelectorElementHeight; } else { overshootAdjustment += mSelectorElementHeight; } } amountToScroll += overshootAdjustment; scrollBy(0, amountToScroll); return true; } return false; }