public class PermissionRequest
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
PermissionRequest.Response
Callback Interface
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
NEEDED_EDITOR_PERMISSIONS
Permissions needed for the Editor Activity
|
static java.lang.String[] |
NEEDED_PREVIEW_PERMISSIONS
Permissions needed for the Preview Activity
|
static java.lang.String[] |
NEEDED_PREVIEW_PERMISSIONS_AND_COARSE_LOCATION
Permissions needed for the Preview Activity
+ ACCESS_COARSE_LOCATION
|
static java.lang.String[] |
NEEDED_PREVIEW_PERMISSIONS_AND_FINE_LOCATION
Permissions needed for the Preview Activity
+ ACCESS_FINE_LOCATION
|
Constructor and Description |
---|
PermissionRequest() |
Modifier and Type | Method and Description |
---|---|
static void |
getPermission(ImgLyIntent.ResultDelegator delegator,
java.lang.String[] permissions,
PermissionRequest.Response response)
Request Android Permissions.
|
static void |
getPermission(ImgLyIntent.ResultDelegator context,
java.lang.String permissions,
PermissionRequest.Response response)
Request Android Permissions.
|
static boolean |
hasAllPermission(android.content.Context context,
java.lang.String[] permissions)
Check if the user has granted the permissions.
|
static void |
onRequestPermissionsResult(int requestCode,
java.lang.String[] permissions,
int[] grantResults)
Must bee called by Activity.onRequestPermissionsResult
|
public static final java.lang.String[] NEEDED_EDITOR_PERMISSIONS
public static final java.lang.String[] NEEDED_PREVIEW_PERMISSIONS
public static final java.lang.String[] NEEDED_PREVIEW_PERMISSIONS_AND_COARSE_LOCATION
public static final java.lang.String[] NEEDED_PREVIEW_PERMISSIONS_AND_FINE_LOCATION
public static void getPermission(@NonNull ImgLyIntent.ResultDelegator delegator, @NonNull java.lang.String[] permissions, @NonNull PermissionRequest.Response response)
delegator
- A ResultDelegator of a Activity or a Fragment.permissions
- The Permissions you are need.response
- Result callback.public static void getPermission(@NonNull ImgLyIntent.ResultDelegator context, java.lang.String permissions, @NonNull PermissionRequest.Response response)
context
- The Context of the Activity or the Fragment.permissions
- The Permission you are need.response
- Result callback.public static boolean hasAllPermission(@NonNull android.content.Context context, @NonNull java.lang.String[] permissions)
context
- a Android contextpermissions
- The Permission you are need to check.public static void onRequestPermissionsResult(int requestCode, java.lang.String[] permissions, @NonNull int[] grantResults)
requestCode
- The automatically generated request codepermissions
- The requested permissionsgrantResults
- The result codes of the requestActivity