https://kotlinlang.org logo
#compose
Title
# compose
p

Piotr Prus

01/26/2021, 4:10 PM
I am trying to make a bottomSheet that opens over mapView. Very similar to current behaviour of google maps. I have a problem with moving the map to the click location. Probably because BottomSheet opens over the map and not resize the mapview. When I move the map, it moves below. I am using
BottomSheetScaffold
. Is it a right component to use here? I put my detail data in
sheetContent
and mapView in
bodyContent
. Any idea how to deal with it? example behaviour: https://streamable.com/balbx
j

Joost Klitsie

01/26/2021, 4:22 PM
If I understand your question well enough, you wish to move the map center (and buttons) up according to how far the bottom sheet opens right?
In that case, Google Maps has a map padding which you can set
you should sync the map padding with the opening of the bottom sheet
the map padding will center your position on the map as well as move the buttons according to the padding
and you will not have to resize the map itself (as that is an expensive operation if my memory serves me right)
p

Piotr Prus

01/26/2021, 4:31 PM
wow, didnt know about the map padding. Will try it out and post here. Thanks!
30 Views