WheelView icon indicating copy to clipboard operation
WheelView copied to clipboard

Smooth Scrolling to next position

Open rahulkapoor1 opened this issue 10 years ago • 3 comments

Is it possible to fix velocity so on scrolling, only items changes and position remain constant. Like moveToNextPos() & moveToPreviousPos();

rahulkapoor1 avatar Sep 17 '15 13:09 rahulkapoor1

I would appreciate a method for one by one smooth scrolling as well, any chance to see this in the future?

simon2041 avatar Oct 12 '16 20:10 simon2041

Hi, Use the below code for smooth scrolling on item select :

public void setSelected(final int rawPosition) { ValueAnimator valueAnimator = ValueAnimator.ofFloat(-1f * getAngleForPosition(mRawSelectedPosition), (-1f * getAngleForPosition(rawPosition))); valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { setAngle((Float) valueAnimator.getAnimatedValue()); } }); valueAnimator.setDuration(2000);//animation duration valueAnimator.start(); }

It work for me. :)

sonusurender avatar Mar 20 '18 09:03 sonusurender

Hi, Use the below code for smooth scrolling on item select :

public void setSelected(final int rawPosition) { ValueAnimator valueAnimator = ValueAnimator.ofFloat(-1f * getAngleForPosition(mRawSelectedPosition), (-1f * getAngleForPosition(rawPosition))); valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @override public void onAnimationUpdate(ValueAnimator valueAnimator) { setAngle((Float) valueAnimator.getAnimatedValue()); } }); valueAnimator.setDuration(2000);//animation duration valueAnimator.start(); }

It work for me. :)

How to get RawPosition of on clicked item?

chiragmalik943 avatar Jan 29 '19 13:01 chiragmalik943