From f9f1b3e39af8154ec7281f774a05e443ba68764c Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Thu, 9 Jun 2022 13:09:10 +0300 Subject: [PATCH] Code review fix. --- .../im/vector/app/features/location/MapTilerMapView.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/location/MapTilerMapView.kt b/vector/src/main/java/im/vector/app/features/location/MapTilerMapView.kt index dd2a56fb3a..1f9cb44c91 100644 --- a/vector/src/main/java/im/vector/app/features/location/MapTilerMapView.kt +++ b/vector/src/main/java/im/vector/app/features/location/MapTilerMapView.kt @@ -33,6 +33,7 @@ import com.mapbox.mapboxsdk.plugins.annotation.SymbolManager import com.mapbox.mapboxsdk.plugins.annotation.SymbolOptions import com.mapbox.mapboxsdk.style.layers.Property import im.vector.app.R +import im.vector.app.core.utils.DimensionConverter import timber.log.Timber class MapTilerMapView @JvmOverloads constructor( @@ -56,6 +57,7 @@ class MapTilerMapView @JvmOverloads constructor( private var mapRefs: MapRefs? = null private var initZoomDone = false private var showLocationButton = false + private var dimensionConverter: DimensionConverter? = null init { context.theme.obtainStyledAttributes( @@ -70,6 +72,7 @@ class MapTilerMapView @JvmOverloads constructor( recycle() } } + dimensionConverter = DimensionConverter(resources) } private fun setLocateButtonVisibility(typedArray: TypedArray) { @@ -151,7 +154,12 @@ class MapTilerMapView @JvmOverloads constructor( pendingState = state } - safeMapRefs.map.uiSettings.setLogoMargins(0, 0, 0, state.logoMarginBottom) + safeMapRefs.map.uiSettings.apply { + setLogoMargins(0, 0, 0, state.logoMarginBottom) + dimensionConverter?.let { + setAttributionMargins(it.dpToPx(88), 0, 0, state.logoMarginBottom) + } + } val pinDrawable = state.pinDrawable ?: userLocationDrawable pinDrawable?.let { drawable ->