Hi,
I’m using the crosshair on the chart and i want to crosshair disappear as soon as i start pinch zoom. So I created a custom PinchZoomModifier and i am doing cursorModifier.setIsEnabled (false) on the onScaleBegin override. But the crosshair does not disappear, it remains steady on the chart, even if I move the chart, it stays at the same point. How can I make crosshair passive when I pinch zoom?
Tnx.
- Emre Gökberk asked 4 years ago
- You must login to post comments
Hi Emre,
Our modifiers weren’t design to support enabling/disabling in the middle of touch gesture. By default we hide modifier when on touch up occurs and if you disable it before this event then it just stops processing further events and freezes in its last state. If you want to remove modifier’s tooltips when you disable it then please try to override on onIsEnabledChanged() and call clearAll() explicitly:
class CustomCursorModifier extends CursorModifier {
@Override
protected void onIsEnabledChanged(boolean isEnabled) {
super.onIsEnabledChanged(isEnabled);
if(!isEnabled)
clearAll();
}
}
Hope this will help you!
Best regards,
Yura
- Yura Khariton answered 4 years ago
- You must login to post comments
Please login first to submit.