mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
5195: Fix upload wizard crash on tapping target icon (#5306)
* LocationPickerActivity: fix crash on setting location for pictures with no EXIF location * strings.xml: remove extra string introduced * optimise constants * LocationPickerActivity: request for permission only on tapping target icon * remove newline * handle location permissions using LocationPermissionsHelper * add null check to prevent crash
This commit is contained in:
parent
70f8256565
commit
2282ce3d02
1 changed files with 9 additions and 6 deletions
|
|
@ -483,14 +483,17 @@ public class LocationPickerActivity extends BaseActivity implements OnMapReadyCa
|
|||
@Override
|
||||
public void onLocationPermissionGranted() {
|
||||
fr.free.nrw.commons.location.LatLng currLocation = locationManager.getLastLocation();
|
||||
if (currLocation != null) {
|
||||
final CameraPosition position;
|
||||
position = new CameraPosition.Builder()
|
||||
.target(new com.mapbox.mapboxsdk.geometry.LatLng(currLocation.getLatitude(), currLocation.getLongitude(), 0)) // Sets the new camera position
|
||||
.target(new com.mapbox.mapboxsdk.geometry.LatLng(currLocation.getLatitude(),
|
||||
currLocation.getLongitude(), 0)) // Sets the new camera position
|
||||
.zoom(mapboxMap.getCameraPosition().zoom) // Same zoom level
|
||||
.build();
|
||||
|
||||
mapboxMap.animateCamera(CameraUpdateFactory.newCameraPosition(position), 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
locationPermissionsHelper.handleLocationPermissions(locationAccessDialog, locationOffDialog);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue