Scroller getCurrY - 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 getCurrY 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, 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, forceFinished, getCurrY, getFinalY, isFinished
    } 
     
    // animation handler 
    private Handler animationHandler = new Handler() {
        public void handleMessage(Message msg) { 
            scroller.computeScrollOffset(); 
            int currY = scroller.getCurrY(); 
            int delta = lastScrollY - currY; 
            lastScrollY = currY; 
            if (delta != 0) { 
                listener.onScroll(delta); 
            } 
             
            // scrolling is not finished when it comes to final Y 
            // so, finish it manually  
            if (Math.abs(currY - scroller.getFinalY()) < MIN_DELTA_FOR_SCROLLING) { 
                currY = scroller.getFinalY(); 
                scroller.forceFinished(true); 
            } 
            if (!scroller.isFinished()) { 

7
CodeRank
This code example shows how to use the following methods:computeScrollOffset, forceFinished, getCurrY, getFinalY, isFinished
    } 
     
    // animation handler 
    private Handler animationHandler = new Handler() {
        public void handleMessage(Message msg) { 
            scroller.computeScrollOffset(); 
            int currY = scroller.getCurrY(); 
            int delta = lastScrollY - currY; 
            lastScrollY = currY; 
            if (delta != 0) { 
                listener.onScroll(delta); 
            } 
             
            // scrolling is not finished when it comes to final Y 
            // so, finish it manually  
            if (Math.abs(currY - scroller.getFinalY()) < MIN_DELTA_FOR_SCROLLING) { 
                currY = scroller.getFinalY(); 
                scroller.forceFinished(true); 
            } 
            if (!scroller.isFinished()) { 

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
This code example shows how to use the following methods:computeScrollOffset, getCurrX, getCurrY, isFinished
	public View getDisplayedView() {
		return mChildViews.get(mCurrent);
	} 
 
	public void run() { 
		if (!mScroller.isFinished()) {
			mScroller.computeScrollOffset();
			int x = mScroller.getCurrX();
			int y = mScroller.getCurrY();
			mXScroll += x - mScrollerLastX;
			mYScroll += y - mScrollerLastY;
			mScrollerLastX = x;
			mScrollerLastY = y;
			requestLayout();
			post(this);
		} else if (!mUserInteracting) {
			View v = mChildViews.get(mCurrent);
			postSettle(v);
		} 
	} 
6
CodeRank

Related Scroller getCurrY Questions & Answers:

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