Code example for Scroller

Methods: flinggetDuration

0
            int height = getHeight() - getPaddingBottom() - getPaddingTop();
            int bottom = getChildAt(0).getHeight();
            int width = getWidth() - getPaddingRight() - getPaddingLeft();
            int right = getChildAt(0).getWidth();
     
            mScroller.fling(getScrollX(), getScrollY(), velocityX, velocityY, 0, right - width, 0, bottom - height);
     
            awakenScrollBars(mScroller.getDuration());
            invalidate();
        } 
    } 
 
    /** 
     * {@inheritDoc} 
     * 
     * <p>This version also clamps the scrolling to the bounds of our child. 
     */ 
    public void scrollTo(int x, int y) {
        // we rely on the fact the View.scrollBy calls scrollTo. 
        if (getChildCount() > 0) {