mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Move pin to center when clicked.
This commit is contained in:
parent
5c359d4d45
commit
10322545aa
@ -45,6 +45,7 @@ import im.vector.app.core.platform.VectorBaseFragment
|
||||
import im.vector.app.core.utils.DimensionConverter
|
||||
import im.vector.app.core.utils.openLocation
|
||||
import im.vector.app.databinding.FragmentLocationLiveMapViewBinding
|
||||
import im.vector.app.features.location.LocationData
|
||||
import im.vector.app.features.location.UrlMapProvider
|
||||
import im.vector.app.features.location.zoomToBounds
|
||||
import im.vector.app.features.location.zoomToLocation
|
||||
@ -137,11 +138,9 @@ class LocationLiveMapViewFragment @Inject constructor() : VectorBaseFragment<Fra
|
||||
|
||||
private fun onSymbolClicked(symbol: Symbol?) {
|
||||
symbol?.let {
|
||||
val screenLocation = mapboxMap?.get()?.projection?.toScreenLocation(it.latLng)
|
||||
views.liveLocationPopupAnchor.apply {
|
||||
x = screenLocation?.x ?: 0f
|
||||
y = (screenLocation?.y ?: 0f) - views.liveLocationPopupAnchor.height
|
||||
}
|
||||
mapboxMap
|
||||
?.get()
|
||||
?.zoomToLocation(LocationData(it.latLng.latitude, it.latLng.longitude, null), preserveCurrentZoomLevel = false)
|
||||
|
||||
LocationLiveMapMarkerOptionsDialog(requireContext())
|
||||
.apply {
|
||||
|
@ -8,8 +8,9 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/liveLocationPopupAnchor"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp" />
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/liveLocationMapFragmentContainer"
|
||||
|
Loading…
Reference in New Issue
Block a user