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:
public boolean onTouchEvent(MotionEvent event) {
boolean b = mViewport.onTouchEvent(event);
boolean a = super.onTouchEvent(event);
// is it a click?
if (mTapDetector.onTouchEvent(event)) {
for (Series s : mSeries) {
s.onTap(event.getX(), event.getY());
}
if (mSecondScale != null) {
for (Series s : 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?
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?