I'm using the Google Maps Android API v2 and I want to be able to open as fullscreen a small map (= SupportMapFragment in my view) on tap (or double tap).
Is this technically possible? If yes, how to achieve it?
Thanks in advance.
I'm using the Google Maps Android API v2 and I want to be able to open as fullscreen a small map (= SupportMapFragment in my view) on tap (or double tap).
Is this technically possible? If yes, how to achieve it?
Thanks in advance.
Copyright © 2021 Jogjafile Inc.
Yes, that is definitely possible.
You could for example have a Button, and upon pressing the Button the MapFragment / SupportMapFragment will be added to a container layout inside your Activity's layout file.
Inside the onClick method of your Button you add the Fragment to the container layout:
In this case, I would recommend that "container_layout" is an empty FrameLayout, used as a placeholder in your Activity's layout file. This is where the Fragment will then appear.
If you really want to use Taps, this is how you can recognize for example a double-tap:
The interface:
The TouchManager:
And inside your Activity (or Customview or wherever you want to recognize the gesture): (In this case tapping on the Activity will call the Touchmanager.
Wherever you want to recognize the gesture, you return GestureDetector.onTouchEvent(...).