0

enter image description here

Should I use fragments? but I want an overlay over the map activity. How can I achieve this?

So far, I have been trying, to add two buttons and on click of a button opens a floating map, but it doesn't give me this result, it resembles a bookmark bar on chrome with three dots on the sides which aren't what I want.

  • Try BottomSheet: https://stackoverflow.com/questions/26721403/android-how-to-implement-bottom-sheet-from-material-design-docs – gioravered Feb 01 '23 at 17:44

2 Answers2

0

Not sure what you are going to do when user will tap on go back or any button or back press

but here i assume it that you are going to remove that white overlay and only map will be shown

if yes then you can simply use map in your activity/fragment whatever you like and white overlay should be created and shown using BottomSheetDialogFragment

to understand how you will create BottomSheetDialogFragment , you can refer this example

https://medium.com/@kosta.palash/using-bottomsheetdialogfragment-with-material-design-guideline-f9814c39b9fc

jayesh gurudayalani
  • 1,368
  • 1
  • 9
  • 14
0

I think the best bet is using coordinatorLayout with a child layout that has BottomsheetBehaviour for the overlay. or simply BottomSheetDialogFragment if user isn't going to interact with map when the overlay is drawn up.

a layout with app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" fits the picture. more on that here

TG. Kahsay
  • 114
  • 5