Example usage for android.widget Scroller isFinished

List of usage examples for android.widget Scroller isFinished

Introduction

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

Prototype

public final boolean isFinished() 

Source Link

Document

Returns whether the scroller has finished scrolling.

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 a  va2s  .  c o 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();
    }
}