From 46a132854036886c5c82336ab8b1e1c7cc4e89a4 Mon Sep 17 00:00:00 2001 From: Fynn Godau Date: Mon, 24 Apr 2023 17:01:11 +0200 Subject: [PATCH] Partially revert 90c175cc48a01d0dd9e2704728c8aa5b199c67ec Setting padding should not cause a camera update, otherwise apps that set map padding upon camera update (e.g. Zomato) loop infinitely. --- .../src/main/kotlin/org/microg/gms/maps/mapbox/GoogleMap.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/GoogleMap.kt b/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/GoogleMap.kt index 662817b61..8bb14fa2b 100644 --- a/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/GoogleMap.kt +++ b/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/GoogleMap.kt @@ -468,9 +468,7 @@ class GoogleMapImpl(context: Context, var options: GoogleMapOptions) : AbstractG override fun setPadding(left: Int, top: Int, right: Int, bottom: Int) = afterInitialize { map -> Log.d(TAG, "setPadding: $left $top $right $bottom") - CameraUpdateFactory.paddingTo(left.toDouble(), top.toDouble(), right.toDouble(), bottom.toDouble()) - .let { map.moveCamera(it) } - + map.setPadding(left, top, right, bottom) val fourDp = mapView?.context?.resources?.getDimension(R.dimen.maplibre_four_dp)?.toInt() ?: 0 val ninetyTwoDp = mapView?.context?.resources?.getDimension(R.dimen.maplibre_ninety_two_dp)?.toInt() -- GitLab