Example usage for android.widget Scroller getStartY

List of usage examples for android.widget Scroller getStartY

Introduction

In this page you can find the example usage for android.widget Scroller getStartY.

Prototype

public final int getStartY() 

Source Link

Document

Returns the start Y offset in the scroll.

Usage

From source file:org.telegram.ui.Components.NumberPicker.java

@Override
public void computeScroll() {
    Scroller scroller = mFlingScroller;
    if (scroller.isFinished()) {
        scroller = mAdjustScroller;//from w w  w  . j  av a 2 s . co m
        if (scroller.isFinished()) {
            return;
        }
    }
    scroller.computeScrollOffset();
    int currentScrollerY = scroller.getCurrY();
    if (mPreviousScrollerY == 0) {
        mPreviousScrollerY = scroller.getStartY();
    }
    scrollBy(0, currentScrollerY - mPreviousScrollerY);
    mPreviousScrollerY = currentScrollerY;
    if (scroller.isFinished()) {
        onScrollerFinished(scroller);
    } else {
        invalidate();
    }
}