LocationPickerActivity.java: rewrite comments to clarify if statement

Before this change, a comment in showInMapApp did not properly describe an if statement's intended behavior.

After this change, the old comment was removed and 2 new comments were added in each part of the if statement
to properly describe the intended behavior.
This commit is contained in:
Jason Whitmore 2024-07-06 16:34:31 -07:00
parent caed893d23
commit e55f4916ee

View file

@ -402,11 +402,12 @@ public class LocationPickerActivity extends BaseActivity implements
private void showInMapApp() { private void showInMapApp() {
fr.free.nrw.commons.location.LatLng position = null; fr.free.nrw.commons.location.LatLng position = null;
//Check to see if EXIF location data is available
if(activity.equals("UploadActivity") && cameraPosition != null){ if(activity.equals("UploadActivity") && cameraPosition != null){
//EXIF location data is available
position = new fr.free.nrw.commons.location.LatLng(cameraPosition.getLatitude(), position = new fr.free.nrw.commons.location.LatLng(cameraPosition.getLatitude(),
cameraPosition.getLongitude(), 0.0f); cameraPosition.getLongitude(), 0.0f);
} else if(mapView != null){ } else if(mapView != null){
//EXIF location data is not available
position = new fr.free.nrw.commons.location.LatLng(mapView.getMapCenter().getLatitude(), position = new fr.free.nrw.commons.location.LatLng(mapView.getMapCenter().getLatitude(),
mapView.getMapCenter().getLongitude(), 0.0f); mapView.getMapCenter().getLongitude(), 0.0f);
} }