You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the listener to make the tapped point bigger and display a snackbar.
Only the snackbar of the series added last to the graph is displayed.
Reason for this behaviour is the handling of onTouchEvent in Graphview:
publicbooleanonTouchEvent(MotionEventevent) {
booleanb = mViewport.onTouchEvent(event);
booleana = super.onTouchEvent(event);
// is it a click?if (mTapDetector.onTouchEvent(event)) {
for (Seriess : mSeries) {
s.onTap(event.getX(), event.getY());
}
if (mSecondScale != null) {
for (Seriess : mSecondScale.getSeries()) {
s.onTap(event.getX(), event.getY());
}
}
}
if two points in two different series have a distance less then 120 to the tap both listeners will be called, because s.onTap(event.getX(), event.getY()); only knows the points of its own series and will call its listener if one point has a distance < 120.
I guess sometimes this may be the expected behaviour, but I dont know if this should be the default behaviour.
Whats your thoughts on this?
The text was updated successfully, but these errors were encountered:
I use the listener to make the tapped point bigger and display a snackbar.
Only the snackbar of the series added last to the graph is displayed.
Reason for this behaviour is the handling of onTouchEvent in Graphview:
if two points in two different series have a distance less then 120 to the tap both listeners will be called, because
s.onTap(event.getX(), event.getY());
only knows the points of its own series and will call its listener if one point has a distance < 120.I guess sometimes this may be the expected behaviour, but I dont know if this should be the default behaviour.
Whats your thoughts on this?
The text was updated successfully, but these errors were encountered: