OverScroller abortAnimation - 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 abortAnimation method.

This code example shows how to use the following methods:abortAnimation, isFinished
    @Override 
    public boolean onInterceptTouchEvent(MotionEvent event) {
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
                //Stop any flinging in progress 
                if (!mScroller.isFinished()) {
                    mScroller.abortAnimation();
                } 
                //Reset the velocity tracker 
                mVelocityTracker.clear();
                mVelocityTracker.addMovement(event);
                //Save the initial touch point 
                mLastTouchX = event.getX();
                mLastTouchY = event.getY();
                break; 
            case MotionEvent.ACTION_MOVE:
                final float x = event.getX();
                final float y = event.getY();
                final int yDiff = (int) Math.abs(y - mLastTouchY);
                final int xDiff = (int) Math.abs(x - mLastTouchX);
6
CodeRank
This code example shows how to use the following methods:abortAnimation
		return mScroller.getCurrX();
	} 
 
	@Override 
	protected void forceFinished( boolean finished ) {
		mScroller.abortAnimation();
	} 
} 
6
CodeRank
This code example shows how to use the following methods:abortAnimation, startScroll
    public float getCurrVelocity() { 
        return mScroller.getCurrVelocity();
    } 
 
    public void setPosition(int position) {
        mScroller.startScroll(
                position, 0,    // startX, startY
                0, 0, 0);       // dx, dy, duration 
 
        // This forces the scroller to reach the final position. 
        mScroller.abortAnimation();
    } 
 
    public void fling(int velocity, int min, int max) {
        int currX = getPosition();
        mScroller.fling(
                currX, 0,      // startX, startY
                velocity, 0,   // velocityX, velocityY
                min, max,      // minX, maxX
                0, 0,          // minY, maxY 
5
CodeRank
This code example shows how to use the following methods:abortAnimation
		return mScroller.getCurrX();
	} 
 
	@Override 
	protected void forceFinished( boolean finished ) {
		mScroller.abortAnimation();
	} 
} 
5
CodeRank
This code example shows how to use the following methods:abortAnimation, startScroll
    public float getCurrVelocity() { 
        return mScroller.getCurrVelocity();
    } 
 
    public void setPosition(int position) {
        mScroller.startScroll(
                position, 0,    // startX, startY
                0, 0, 0);       // dx, dy, duration 
 
        // This forces the scroller to reach the final position. 
        mScroller.abortAnimation();
    } 
 
    public void fling(int velocity, int min, int max) {
        int currX = getPosition();
        mScroller.fling(
                currX, 0,      // startX, startY
                velocity, 0,   // velocityX, velocityY
                min, max,      // minX, maxX
                0, 0,          // minY, maxY 
5
CodeRank
This code example shows how to use the following methods:abortAnimation
		return mScroller.getCurrX();
	} 
 
	@Override 
	protected void forceFinished( boolean finished ) {
		mScroller.abortAnimation();
	} 
} 
4
CodeRank
This code example shows how to use the following methods:abortAnimation
		return mScroller.getCurrX();
	} 
 
	@Override 
	protected void forceFinished( boolean finished ) {
		mScroller.abortAnimation();
	} 
} 
4
CodeRank
abortAnimation Method Overview
Stops the animation.
See Code Examples for other Android OverScroller Methods: