OverScroller computeScrollOffset - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for OverScroller computeScrollOffset method.

This code example shows how to use the following methods:computeScrollOffset, getCurrX, getCurrY
		} 
	}; 
	 
	@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);
6
CodeRank
This code example shows how to use the following methods:computeScrollOffset, getCurrX, getCurrY
        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);
6
CodeRank
This code example shows how to use the following methods:computeScrollOffset
		mScroller.startScroll( initialX, 0, distance, 0, mAnimationDuration );
	} 
 
	@Override 
	protected boolean computeScrollOffset() { 
		return mScroller.computeScrollOffset();
	} 
 
	@Override 
	protected int getCurrX() { 
		return mScroller.getCurrX();
	} 
 
	@Override 
	protected void forceFinished( boolean finished ) {
		mScroller.abortAnimation();
	} 
} 
6
CodeRank
This code example shows how to use the following methods:computeScrollOffset, getCurrVelocity, getCurrX, getCurrY
        mDelegate.invalidate();
    } 
 
    // Called immediately before the draw to update the scroll offset. 
    public void computeScrollAndAbsorbGlow(OverScrollGlow overScrollGlow) {
        final boolean stillAnimating = mScroller.computeScrollOffset();
        if (!stillAnimating) return;
 
        final int oldX = mDelegate.getContainerViewScrollX();
        final int oldY = mDelegate.getContainerViewScrollY();
        int x = mScroller.getCurrX();
        int y = mScroller.getCurrY();
 
        int rangeX = computeMaximumHorizontalScrollOffset();
        int rangeY = computeMaximumVerticalScrollOffset();
 
        if (overScrollGlow != null) {
            overScrollGlow.absorbGlow(x, y, oldX, oldY, rangeX, rangeY,
                    mScroller.getCurrVelocity());
        } 

5
CodeRank
This code example shows how to use the following methods:computeScrollOffset
		mScroller.startScroll( initialX, 0, distance, 0, mAnimationDuration );
	} 
 
	@Override 
	protected boolean computeScrollOffset() { 
		return mScroller.computeScrollOffset();
	} 
 
	@Override 
	protected int getCurrX() { 
		return mScroller.getCurrX();
	} 
 
	@Override 
	protected void forceFinished( boolean finished ) {
		mScroller.abortAnimation();
	} 
} 
5
CodeRank
This code example shows how to use the following methods:computeScrollOffset
     * Call this when you want to know the new location. The position will be 
     * updated and can be obtained by getPosition(). Returns true if  the 
     * animation is not yet finished. 
     */ 
    public boolean advanceAnimation(long currentTimeMillis) {
        return mScroller.computeScrollOffset();
    } 
 
    public boolean isFinished() { 
        return mScroller.isFinished();
    } 
 
    public void forceFinished() { 
        mScroller.forceFinished(true);
    } 
 
    public int getPosition() { 
        return mScroller.getCurrX();
    } 
 
5
CodeRank
This code example shows how to use the following methods:computeScrollOffset
			mScroller = new OverScroller(context);
		} 
 
		@Override 
		public boolean computeScrollOffset() { 
			return mScroller.computeScrollOffset();
		} 
 
		@Override 
		public void fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY,
				int overX, int overY) {
			mScroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY, overX, overY);
		} 
 
		@Override 
		public void forceFinished(boolean finished) {
			mScroller.forceFinished(finished);
		} 
 
		@Override 
4
CodeRank
This code example shows how to use the following methods:computeScrollOffset
		mScroller.startScroll( initialX, 0, distance, 0, mAnimationDuration );
	} 
 
	@Override 
	protected boolean computeScrollOffset() { 
		return mScroller.computeScrollOffset();
	} 
 
	@Override 
	protected int getCurrX() { 
		return mScroller.getCurrX();
	} 
 
	@Override 
	protected void forceFinished( boolean finished ) {
		mScroller.abortAnimation();
	} 
} 
4
CodeRank
This code example shows how to use the following methods:computeScrollOffset, getCurrVelocity, getCurrX
		init(context);
	} 
 
	@Override 
	public void computeScroll() { 
		if (mScroller.computeScrollOffset()) {
			int oldX = getScrollX();
			int x = mScroller.getCurrX();
 
			if (oldX != x) {
				overScrollBy(x - oldX, 0, oldX, 0, mScrollRange, 0, mOverflingDistance, 0, false);
				onScrollChanged(x, 0, oldX, 0);
 
				if (x < 0 && oldX >= 0) {
					mEdgeEffectLeft.onAbsorb((int) mScroller.getCurrVelocity());
				} else if (x > mScrollRange && oldX <= mScrollRange) {
					mEdgeEffectRight.onAbsorb((int) mScroller.getCurrVelocity());
				} 
			} 
		} 

4
CodeRank
This code example shows how to use the following methods:computeScrollOffset
     * Call this when you want to know the new location. The position will be 
     * updated and can be obtained by getPosition(). Returns true if  the 
     * animation is not yet finished. 
     */ 
    public boolean advanceAnimation(long currentTimeMillis) {
        return mScroller.computeScrollOffset();
    } 
 
    public boolean isFinished() { 
        return mScroller.isFinished();
    } 
 
    public void forceFinished() { 
        mScroller.forceFinished(true);
    } 
 
    public int getPosition() { 
        return mScroller.getCurrX();
    } 
 
4
CodeRank
computeScrollOffset Method Overview
Call this when you want to know the new location.
See Code Examples for other Android OverScroller Methods: