Search code examples
androidandroid-fragments

Android, Non rectangular click area


I have an activity that must be used horizontally. This activity shows a map and when I click on it, a toolbar is supposed to pop from the right side of the screen (which is actually the bottom if we are looking vertically).

I thought of implementing this toolbar as a container of fragments because each button triggers different stuff to appear on the toolbar.

First of all, is it the best way to implement such a toolbar? Or are there more android oriented ways? Secondly, I would like touching the "transparent" space under the X button to send this signal to the map, but when I touch the "black transparent" it will not. From what I've read, the only way is when clicking check coordinates and see if they fall inside my area, but it sounds too hardcoded and ugly solution. Is there a better one? Maybe there is a way to make the holding layout fit the image and not be rectangular?


Solution

  • For a more android oriented way you can use the Navigation drawer.

    I don't know if it fit exactly with what you want but Navigation drawers are a good way to create right or left menu/toolbar.

    You can find the documentation here:

    https://developer.android.com/design/patterns/navigation-drawer.html

    http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html