From 47eaff429a89d05d14e87d17bc9b42d81971a630 Mon Sep 17 00:00:00 2001 From: Jason Whitmore Date: Sun, 7 Jul 2024 19:58:30 -0700 Subject: [PATCH] LocationPickerActivity.java: replace code with a method call Before this change, there was several lines of code which moved the map center to the EXIF location. After this change, the several lines of code have been replaced with a simpler method call which produces the same result. --- .../commons/LocationPicker/LocationPickerActivity.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/LocationPicker/LocationPickerActivity.java b/app/src/main/java/fr/free/nrw/commons/LocationPicker/LocationPickerActivity.java index 7f316250c..fedeb16a2 100644 --- a/app/src/main/java/fr/free/nrw/commons/LocationPicker/LocationPickerActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/LocationPicker/LocationPickerActivity.java @@ -358,12 +358,7 @@ public class LocationPickerActivity extends BaseActivity implements smallToolbarText.setText(getResources().getString(R.string.pan_and_zoom_to_adjust)); fabCenterOnLocation.setVisibility(View.VISIBLE); removeSelectedLocationMarker(); - if (cameraPosition != null && mapView != null) { - if (mapView.getController() != null) { - mapView.getController().animateTo(new GeoPoint(cameraPosition.getLatitude(), - cameraPosition.getLongitude())); - } - } + moveMapToMediaLocation(); } /** @@ -401,7 +396,7 @@ public class LocationPickerActivity extends BaseActivity implements */ private void showInMapApp() { fr.free.nrw.commons.location.LatLng position = null; - + if(activity.equals("UploadActivity") && cameraPosition != null){ //EXIF location data is available position = new fr.free.nrw.commons.location.LatLng(cameraPosition.getLatitude(),