mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
5195: Fix crash on setting location for pictures with no EXIF location (#5205)
* 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
This commit is contained in:
parent
6881158743
commit
4caa8a509b
5 changed files with 53 additions and 20 deletions
|
|
@ -68,12 +68,8 @@ public class LocationPermissionsHelper {
|
|||
},
|
||||
() -> {
|
||||
if (callback != null) {
|
||||
Toast.makeText(
|
||||
activity,
|
||||
R.string.in_app_camera_location_permission_denied,
|
||||
Toast.LENGTH_LONG
|
||||
).show();
|
||||
callback.onLocationPermissionDenied();
|
||||
callback.onLocationPermissionDenied(activity.getString(
|
||||
R.string.in_app_camera_location_permission_denied));
|
||||
}
|
||||
},
|
||||
locationAccessDialog.dialogTitleResource,
|
||||
|
|
@ -102,14 +98,8 @@ public class LocationPermissionsHelper {
|
|||
activity.getString(R.string.title_app_shortcut_setting),
|
||||
activity.getString(R.string.cancel),
|
||||
() -> openLocationSettings(),
|
||||
() -> {
|
||||
Toast.makeText(
|
||||
activity,
|
||||
R.string.in_app_camera_location_unavailable,
|
||||
Toast.LENGTH_LONG
|
||||
).show();
|
||||
callback.onLocationPermissionDenied();
|
||||
});
|
||||
() -> callback.onLocationPermissionDenied(activity.getString(
|
||||
R.string.in_app_camera_location_unavailable)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -131,7 +121,7 @@ public class LocationPermissionsHelper {
|
|||
* Handle onPermissionDenied within individual classes based on the requirements
|
||||
*/
|
||||
public interface LocationPermissionCallback {
|
||||
void onLocationPermissionDenied();
|
||||
void onLocationPermissionDenied(String toastMessage);
|
||||
void onLocationPermissionGranted();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue