WheelView icon indicating copy to clipboard operation
WheelView copied to clipboard

setEnabled() isn't working

Open LApptelier opened this issue 9 years ago • 4 comments

Hello,

I'd like to use the setEnabled() method to prevent the user to interact with the wheel. So far, it doesn't seems to work. I've only tested that on Android 4.4 so far.

Any ideas ?

LApptelier avatar Feb 20 '16 19:02 LApptelier

` @Override public boolean onTouchEvent(@NonNull MotionEvent event) { final float x = event.getX(); final float y = event.getY();

// --- Start code added by me

//the wheel is fling, the user can't interact with the wheel when is flying
if( mAngularVelocity != 0 || !isEnabled() ){
    return false;
}
// --- End code added by me
.....

`

Hi, I've made a customization to the wheel view. This code prevent the user to interact with the wheel while is flying.

This code goes in the WheelView.java file

Hope this help.

Regards

juansebahler avatar Feb 20 '16 19:02 juansebahler

Hello @juansebahler

But i'd like something "simpler" to use. I'd like to not modify the library in order to maintain my app more easily.

Thanks anyway for the idea, hope it can maybe help someone else :)

LApptelier avatar Feb 20 '16 19:02 LApptelier

I was faced with the same problem Any solutions?

kovac777 avatar Sep 09 '16 13:09 kovac777

Please feel free to open a pull request if you'd like to not maintain a separate version :)

Alternatively you could extend WheelView and override the onTouchEvent to wrap the logic you require.

LukeDeighton avatar Sep 09 '16 14:09 LukeDeighton