Scroller getCurrX - top ranked examples from Open Source projects

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

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();
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;
    } 
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;
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();
        } 
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
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();
		} 
9
CodeRank
This code example shows how to use the following methods:computeScrollOffset, getCurrX
        } 
        if (mBehindView == null) {
            mBehindView = findViewWithTag("Behind");
        } 
 
        if (mScroller.computeScrollOffset()) {
            int x = mScroller.getCurrX();
            if (x > 0) {
                x = x - (getMeasuredWidth()-mRightSpaceWidth);
            } 
            mWrapView.scrollTo(x, 0);
            postInvalidate();
        } 
    } 
 
    public void setBehindView(View view) {
        if (mBehindView != null) {
            removeView(mBehindView);
        } 
        mBehindView = view;
7
CodeRank
This code example shows how to use the following methods:computeScrollOffset, getCurrX
					getHeight());
		} 
	} 
 
	public void computeScroll() { 
		if (scroller.computeScrollOffset()) {
			scrollTo(scroller.getCurrX(), 0);
			postInvalidate();
		} 
	} 
 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		// TODO Auto-generated method stub 
		gestureDetector.onTouchEvent(event);
		switch (event.getAction()) {
		case MotionEvent.ACTION_DOWN:
			break; 
		case MotionEvent.ACTION_MOVE:
			break; 
7
CodeRank
This code example shows how to use the following methods:computeScrollOffset, getCurrX, getCurrY, isFinished
		postInvalidate();
	} 
 
	@Override 
	public void computeScroll() { 
		if (!mScroller.isFinished()) {
			if (mScroller.computeScrollOffset()) {
				int oldX = mSlidingView.getScrollX();
				int oldY = mSlidingView.getScrollY();
				int x = mScroller.getCurrX();
				int y = mScroller.getCurrY();
				if (oldX != x || oldY != y) {
					if (mSlidingView != null) {
						mSlidingView.scrollTo(x, y);
						if (x < 0)
							bgShade.scrollTo(x + 20, y);// 背景阴影右偏
						else 
							bgShade.scrollTo(x - 20, y);// 背景阴影左偏
					} 
				} 
6
CodeRank
This code example shows how to use the following methods:computeScrollOffset, getCurrX, getCurrY
        scrollTo(mCurrentView * width, 0);
    } 
 
    @Override 
    public void computeScroll() { 
        if (mScroller.computeScrollOffset()) {
            scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
            postInvalidate();
        } 
    } 
 
    public int getPosition() { 
        return mCurrentView;
    } 
 
    public void setPosition(int position) {
        mCurrentView = position;
    } 
 
    @Override 
8
CodeRank

Related Scroller getCurrX Questions & Answers:

getCurrX Method Overview
Returns the current X offset in the scroll.
See Code Examples for other Android Scroller Methods: