mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-03 05:20:12 +01:00
Code review fix.
This commit is contained in:
parent
9b22880d57
commit
f9f1b3e39a
@ -33,6 +33,7 @@ import com.mapbox.mapboxsdk.plugins.annotation.SymbolManager
|
|||||||
import com.mapbox.mapboxsdk.plugins.annotation.SymbolOptions
|
import com.mapbox.mapboxsdk.plugins.annotation.SymbolOptions
|
||||||
import com.mapbox.mapboxsdk.style.layers.Property
|
import com.mapbox.mapboxsdk.style.layers.Property
|
||||||
import im.vector.app.R
|
import im.vector.app.R
|
||||||
|
import im.vector.app.core.utils.DimensionConverter
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
class MapTilerMapView @JvmOverloads constructor(
|
class MapTilerMapView @JvmOverloads constructor(
|
||||||
@ -56,6 +57,7 @@ class MapTilerMapView @JvmOverloads constructor(
|
|||||||
private var mapRefs: MapRefs? = null
|
private var mapRefs: MapRefs? = null
|
||||||
private var initZoomDone = false
|
private var initZoomDone = false
|
||||||
private var showLocationButton = false
|
private var showLocationButton = false
|
||||||
|
private var dimensionConverter: DimensionConverter? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
context.theme.obtainStyledAttributes(
|
context.theme.obtainStyledAttributes(
|
||||||
@ -70,6 +72,7 @@ class MapTilerMapView @JvmOverloads constructor(
|
|||||||
recycle()
|
recycle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dimensionConverter = DimensionConverter(resources)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setLocateButtonVisibility(typedArray: TypedArray) {
|
private fun setLocateButtonVisibility(typedArray: TypedArray) {
|
||||||
@ -151,7 +154,12 @@ class MapTilerMapView @JvmOverloads constructor(
|
|||||||
pendingState = state
|
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
|
val pinDrawable = state.pinDrawable ?: userLocationDrawable
|
||||||
pinDrawable?.let { drawable ->
|
pinDrawable?.let { drawable ->
|
||||||
|
Loading…
Reference in New Issue
Block a user