venkivenkat / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

ItemizedIconOverlay uses onSingleTapUp for detecting taps, when it should be using OnSingleTapConfirmed #450

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
ItemizedIconOverlay uses onSingleTapUp for detecting taps which means a 
double-tap will trigger item selection. It should be using OnSingleTapConfirmed.

Original issue reported on code.google.com by kurtzm...@gmail.com on 15 Jul 2013 at 4:44

GoogleCodeExporter commented 9 years ago
Workaround for this is extend ItemizedIconOverlay and override this methods

@Override
public boolean onSingleTapUp(MotionEvent event, MapView mapView) {
    return false;
}

@Override
public boolean onSingleTapConfirmed(MotionEvent e, MapView mapView) {
    return super.onSingleTapUp(e, mapView);
}

but it would be nice have this in "vanilla" code :)

Original comment by lukas.vy...@gmail.com on 16 Jul 2013 at 9:59

GoogleCodeExporter commented 9 years ago
Updated by r1256. Use onSingleTapConfirmed instead of onSingleTapUp for 
detecting taps. This prevents double-tapping from triggering an item tap.

Please test and report back results.

Original comment by kurtzm...@gmail.com on 25 Jul 2013 at 3:09

GoogleCodeExporter commented 9 years ago
Hi,

If we use the ItemizedIconOverlay:
I see that with the latest change the ItemizedOverlay.hitTest is called 2 times.
One time from ItemizedIconOverlay.onSingleTapConfirmed through 
ItemizedIconOverlay.activateSelectedItems
And if it returns false, then another one time through 
super.onSingleTapConfirmed at ItemizedOverlay.onSingleTapConfirmed

What's the reason for that super call, can we avoid it? Don't we already 
perform the hit test at ItemizedIconOverlay?

Regards.

Original comment by devemu...@gmail.com on 25 Jul 2013 at 5:50

GoogleCodeExporter commented 9 years ago
ItemizedIconOverlay is user-contributed code. There is no Google-API 
equivalent. Consequently there is no guidance as to how it "should" be 
implemented. I don't know why there is an activateSelectedItems() since that 
could be done in onTap(). I'm inclined to leave it the way it is where the 
ItemizedIconOverlay provides activateSelectedItems() functionality and the 
ItemizedIconOverlay provides the onTap() functionality and the user can choose 
which hook works best for their tapping needs.

I don't know how much attention will be given to the concrete subclasses of 
ItemizedOverlay that are provided in the osmdroid library moving forward. I 
think they should be considered examples and be put into the sample project. 
They probably have been far surpassed by the functionality provided by 
osmbonuspack. Maybe they should be deprecated?

Original comment by kurtzm...@gmail.com on 25 Jul 2013 at 7:52

GoogleCodeExporter commented 9 years ago
The primary fix has been released in 4.0. Additional changes discussed won't be 
implemented at this time.

Original comment by kurtzm...@gmail.com on 25 Oct 2013 at 1:51