With MPAndroidChart, how can I stop an ongoing fling event initiated by the user?
Example:
User flings the plot backwards, plot keeps scrolling backwards after touching. User presses button "Resume", app calls chart.moveViewToX(dataSet.getEntryCount())
, but view is not actually moved until the fling event comes to a complete halt, which can take several seconds.
In other words, I am looking for a solution that executes moveViewToX
immediately without waiting for the fling to complete.
By dispatching a new ACTION_DOWN
event, we can stop the ongoing fling event:
chart.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, 0, 0, 0));
Source: Stop ListView scroll animation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With