Best code examples for Android Scroller class (android.widget.Scroller)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Scroller class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android Scroller examples from Open Source projects
This code example shows how to use the following methods: computeScrollOffset, getCurrX, getCurrY
		return mCurScreen;
	} 
 
	@Override 
	public void computeScroll() { 
		if (mScroller.computeScrollOffset()) {
			scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
			postInvalidate();
		} 
	} 
 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		//是否可滑动 
		if(!isScroll) {
			return false; 
		} 
		 
		if (mVelocityTracker == null) {
			mVelocityTracker = VelocityTracker.obtain();
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: computeScrollOffset, getCurrX, getCurrY
        init(); 
    } 
 
    @Override 
    public void computeScroll() { 
        if (scroller.computeScrollOffset()) {
            scrollTo(scroller.getCurrX(), scroller.getCurrY());
            postInvalidate();
        } else if (mNextScreen != INVALID_SCREEN) {
            mCurrentScreen = Math.max(0, Math.min(mNextScreen, getChildCount() - 1));
            if (listener != null) {
                listener.onScreenSwitch(mCurrentScreen);
            } 
            mNextScreen = INVALID_SCREEN;
        } 
    } 
 
    public int getCurrentScreen() { 
        return mCurrentScreen;
    } 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: computeScrollOffset, getCurrX
        return res;
    } 
 
    @Override 
    public void computeScroll() { 
        if (scroller.computeScrollOffset()) {
            setCurrentValue(scroller.getCurrX());
            invalidate();
        } else if (!inTouch) {
            zoomModel.commit();
        } 
    } 
 
    public float getCurrentValue() { 
        return (zoomModel.getZoom() - 1.0f) * MULTIPLIER;
    } 
 
    public void setCurrentValue(float currentValue) {
        if (currentValue < 0.0) {
            currentValue = 0.0f;
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: computeScrollOffset, getCurrX, getCurrY
    } 
 
    @Override 
    public void computeScroll() { 
 
        if (mScroller.computeScrollOffset()) {
            scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
            postInvalidate();
        } 
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent event) {
 
        if (!enableScroll) {
            return super.onTouchEvent(event);
        } 
        if (mVelocityTracker == null) {
            mVelocityTracker = VelocityTracker.obtain();
        } 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: abortAnimation, computeScrollOffset, getCurrX, getCurrY, startScroll
	 *  >0±íʾÔÚ×îԭʼµÄ»ù´¡ÉÏÏò×óÆ«ÒÆÁË <0 ±íʾÔÚ×îԭʼµÄ»ù´¡ÉÏÏòÓÒÆ«ÒÆÁË 
	 *  
	 */ 
	@Override 
	public void computeScroll() { 
		if (scroller.computeScrollOffset()) {
			int curX = scroller.getCurrX();
			this.scrollTo(curX, scroller.getCurrY());
			invalidate();// Ë¢ÐÂ
			Log.e("", "curX=" + curX);
			if (curX == -width && isMenuOpen) {
				scroller.abortAnimation();
				closeMenuPull02(); 
			} 
		} 
	} 
 
	/** 
	 * startScroll·½·¨ÓÐÎå¸ö²ÎÊý int startX ˮƽ·½Ïò¿ªÊ¼¹ö¶¯µÄÆ«ÒÆÖµ£¨Ïà¶ÔÓÚ×îԭʼµÄλÖã©£¬>0±íʾÏò×óÆ«ÒÆÁË£¬<0±íʾÏòÓÒÆ«ÒÆÁË 
	 * int startY, ͬÉÏ£¬´¹Ö±·½Ïò¡£ >0±íʾÏòÉÏÆ«ÒÆÁË int dx, ˮƽ·½ÏòÒƶ¯µÄ¾àÀ룬>0Ïò×óÆ«ÒÆ£¬<0ÏòÓÒÆ«ÒÆ int dy, 

8
CodeRank
Related Android Scroller Questions & Answers:
See Code Examples for Android Scroller Methods: