Code example for OverScroller

Methods: computeScrollOffsetgetCurrXgetCurrY

0
        child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
    } 
	 
	@Override 
	public void computeScroll() { 
        if (mScroller.computeScrollOffset()) {
            // This is called at drawing time by ViewGroup.  We use 
            // this method to keep the fling animation going through 
            // to completion. 
            int oldX = getScrollX();
            int oldY = getScrollY();
            int x = mScroller.getCurrX();
            int y = mScroller.getCurrY();
 
            if (getChildCount() > 0) {
                View child = getChildAt(0);
                x = clamp(x, getWidth() - getPaddingRight() - getPaddingLeft(), child.getWidth());
                y = clamp(y, getHeight() - getPaddingBottom() - getPaddingTop(), child.getHeight());
                if (x != oldX || y != oldY) {
                    scrollTo(x, y);
Experience pair programming with AI  Get Codota for Java