From 68c6e524d288b2fe5d6fba0040309609a47c1c5c Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Tue, 7 Jun 2022 18:22:09 +0300 Subject: [PATCH] Use dynamic height to calculate the position of the copyright attributes. --- .../location/live/map/LocationLiveMapViewFragment.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewFragment.kt b/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewFragment.kt index 88a032041a..5f2410d697 100644 --- a/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewFragment.kt +++ b/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewFragment.kt @@ -25,6 +25,7 @@ import androidx.core.graphics.drawable.toBitmap import androidx.lifecycle.lifecycleScope import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.withState +import com.google.android.material.bottomsheet.BottomSheetBehavior import com.mapbox.mapboxsdk.geometry.LatLng import com.mapbox.mapboxsdk.geometry.LatLngBounds import com.mapbox.mapboxsdk.maps.MapView @@ -96,10 +97,11 @@ class LocationLiveMapViewFragment @Inject constructor() : VectorBaseFragment + val bottomSheetHeight = BottomSheetBehavior.from(views.bottomSheet).peekHeight mapboxMap.uiSettings.apply { // Place copyright above the user list bottom sheet - setLogoMargins(dimensionConverter.dpToPx(8), 0, 0, dimensionConverter.dpToPx(208)) - setAttributionMargins(dimensionConverter.dpToPx(96), 0, 0, dimensionConverter.dpToPx(208)) + setLogoMargins(dimensionConverter.dpToPx(8), 0, 0, bottomSheetHeight + dimensionConverter.dpToPx(8)) + setAttributionMargins(dimensionConverter.dpToPx(96), 0, 0, bottomSheetHeight + dimensionConverter.dpToPx(8)) } lifecycleScope.launch {