mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-31 23:03:54 +01:00
LocationPickerActivity.java: remove redundant method, renaming method
Before this change, there were two methods with the same behavior. This change removes the newer method and renames the old method to the descriptive name the newer one had. Additionally, code which calls this method has been changed to reflect the new name.
This commit is contained in:
parent
bff14dafde
commit
d1c849af36
1 changed files with 9 additions and 18 deletions
|
|
@ -272,19 +272,6 @@ public class LocationPickerActivity extends BaseActivity implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Moves the center of the map to the media's location (likely EXIF data), if that data
|
|
||||||
* is available.
|
|
||||||
*/
|
|
||||||
private void moveMapToMediaLocation(){
|
|
||||||
if(cameraPosition != null){
|
|
||||||
double latitude = cameraPosition.getLatitude();
|
|
||||||
double longitude = cameraPosition.getLongitude();
|
|
||||||
|
|
||||||
moveMapTo(latitude, longitude);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For showing credits
|
* For showing credits
|
||||||
*/
|
*/
|
||||||
|
|
@ -340,7 +327,7 @@ public class LocationPickerActivity extends BaseActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupMapView() {
|
private void setupMapView() {
|
||||||
adjustCameraBasedOnOptions();
|
moveMapToMediaLocation();
|
||||||
modifyLocationButton.setOnClickListener(v -> onClickModifyLocation());
|
modifyLocationButton.setOnClickListener(v -> onClickModifyLocation());
|
||||||
removeLocationButton.setOnClickListener(v -> onClickRemoveLocation());
|
removeLocationButton.setOnClickListener(v -> onClickRemoveLocation());
|
||||||
showInMapButton.setOnClickListener(v -> showInMap());
|
showInMapButton.setOnClickListener(v -> showInMap());
|
||||||
|
|
@ -416,12 +403,16 @@ public class LocationPickerActivity extends BaseActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* move the location to the current media coordinates
|
* Moves the center of the map to the media's location (likely EXIF data), if that data
|
||||||
|
* is available.
|
||||||
*/
|
*/
|
||||||
private void adjustCameraBasedOnOptions() {
|
private void moveMapToMediaLocation() {
|
||||||
if (cameraPosition != null) {
|
if (cameraPosition != null) {
|
||||||
mapView.getController().setCenter(new GeoPoint(cameraPosition.getLatitude(),
|
|
||||||
cameraPosition.getLongitude()));
|
GeoPoint point = new GeoPoint(cameraPosition.getLatitude(),
|
||||||
|
cameraPosition.getLongitude());
|
||||||
|
|
||||||
|
moveMapTo(point);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue