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).
This commit is contained in:
Jason Whitmore 2024-07-05 16:25:53 -07:00
parent 442ab08711
commit 97fa77deb8

View file

@ -329,6 +329,15 @@ public class LocationPickerActivity extends BaseActivity implements
private void setupMapView() { private void setupMapView() {
requestLocationPermissions(); 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()); modifyLocationButton.setOnClickListener(v -> onClickModifyLocation());
removeLocationButton.setOnClickListener(v -> onClickRemoveLocation()); removeLocationButton.setOnClickListener(v -> onClickRemoveLocation());
showInMapButton.setOnClickListener(v -> showInMapApp()); showInMapButton.setOnClickListener(v -> showInMapApp());