Kingjuli / osmdroid

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

Fix issue with setClickable causing no scrolling #442

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Because of the way dispatchTouchEvent is handled, if setClickable() is true for 
the MapView then scrolling doesn't work since the MapView consumes the touch 
event. This is causing a lot of confusion with users who errantly set the 
clickable property.

I have been trying the following solution in MapView, and it appears to be 
working well for me:

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        return false;
    }

This will prevent the MapView itself from consuming touch events, even if 
setClickable is true. Child views to the MapView can still receive touch 
events, multi-touch works, overlay touches work, etc...

I am going to commit the fix. Please report any issues to this ticket.

Original issue reported on code.google.com by kurtzm...@gmail.com on 25 Jun 2013 at 1:43

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r1250.

Prevent MapView from consuming touch events when setClickable(true).

Original comment by kurtzm...@gmail.com on 25 Jun 2013 at 9:30

GoogleCodeExporter commented 8 years ago

Original comment by kurtzm...@gmail.com on 25 Jun 2013 at 9:30

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This has been released in 4.0.

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