From 97fa77deb85fbc617d807f823c39e2bbd4e9b3ae Mon Sep 17 00:00:00 2001 From: Jason Whitmore Date: Fri, 5 Jul 2024 16:25:53 -0700 Subject: [PATCH] LocationPickerActivity.java: add code to move map to either EXIF or device GPS location Before this change, there was no explicit if check on whether there was EXIF data available before moving the location picker map. After this change, an explicit if check (which checks the activity name string) will move the location picker map to either the EXIF location (if that data is available) or to the device's GPS location (if EXIF data is not available). --- .../commons/LocationPicker/LocationPickerActivity.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 54c90edcc..45c0c5b8d 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 @@ -329,6 +329,15 @@ public class LocationPickerActivity extends BaseActivity implements private void setupMapView() { requestLocationPermissions(); + + //If EXIF data is available, move map to EXIF location. + if(activity.equals("UploadActivity")){ + moveMapToMediaLocation(); + } else { + //EXIF data is not available. Move map to device GPS location. + moveMapToGPSLocation(); + } + modifyLocationButton.setOnClickListener(v -> onClickModifyLocation()); removeLocationButton.setOnClickListener(v -> onClickRemoveLocation()); showInMapButton.setOnClickListener(v -> showInMapApp());