From b803474e22d8559c22f8329120c7ced8c579d4b0 Mon Sep 17 00:00:00 2001 From: Jason Whitmore Date: Mon, 8 Jul 2024 14:44:53 -0700 Subject: [PATCH] LocationPickerActivity.java: remove redundant code Before this change, there was two sections of code which moved the map center to the same location. Both of these code sections occur very close to each other (one in onCreate(), the other in setupMapView()) After this change, the code section in onCreate() has been removed. With the map centering code only in the setupMapView() method. This change eliminates redundancy, reduces the amount of code in onCreate(), and makes this java file easier to understand. --- .../commons/LocationPicker/LocationPickerActivity.java | 10 ---------- 1 file changed, 10 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 fedeb16a2..f34fec6af 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 @@ -238,16 +238,6 @@ public class LocationPickerActivity extends BaseActivity implements cameraPosition.getLongitude())); } setupMapView(); - - if("UploadActivity".equals(activity)){ - if(mapView != null && mapView.getController() != null && cameraPosition != null){ - GeoPoint cameraGeoPoint = new GeoPoint(cameraPosition.getLatitude(), - cameraPosition.getLongitude()); - - mapView.getController().setCenter(cameraGeoPoint); - mapView.getController().animateTo(cameraGeoPoint); - } - } } /**