Class DynamicPermissionUtils
java.lang.Object
com.pranavpandey.android.dynamic.support.util.DynamicPermissionUtils
Helper class to work with permissions and
DynamicPermission
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
getPermissionIcon
(String permission) Get permission icon drawable resource according to the permission name.static String
getPermissionSettingsAction
(String permission) Get permission settings action according to the permission name.static int
getPermissionSubtitle
(String permission) Get permission subtitle string resource according to the permission name.static int
getPermissionTitle
(String permission) Get permission title string resource according to the permission name.static boolean
launchAppInfo
(Context context) Launch app info by extracting the package name from the supplied context.static boolean
openPermissionSettings
(Context context, String permission) Open the settings activity according to the permission name.static boolean
openPermissionSettings
(Context context, String permission, Class<?> clazz) Open the settings activity according to the permission name.
-
Constructor Details
-
DynamicPermissionUtils
public DynamicPermissionUtils()
-
-
Method Details
-
getPermissionSettingsAction
Get permission settings action according to the permission name.- Parameters:
permission
- The permission name.- Returns:
- The permission settings action.
-
openPermissionSettings
public static boolean openPermissionSettings(@NonNull Context context, @NonNull String permission, @Nullable Class<?> clazz) Open the settings activity according to the permission name.- Parameters:
context
- The context to start the activity.permission
- The permission name.clazz
- The optional class to be supplied as bundle.- Returns:
true
if permissions settings activity can be opened successfully. Otherwise,false
.
-
openPermissionSettings
Open the settings activity according to the permission name.- Parameters:
context
- The context to start the activity.permission
- The permission name.- Returns:
true
if permissions settings activity can be opened successfully. Otherwise,false
.- See Also:
-
launchAppInfo
Launch app info by extracting the package name from the supplied context.- Parameters:
context
- The context to start the activity.- Returns:
true
if permissions settings activity can be opened successfully. Otherwise,false
.
-
getPermissionIcon
Get permission icon drawable resource according to the permission name.- Parameters:
permission
- The permission name.- Returns:
- The permission icon drawable resource.
-
getPermissionTitle
Get permission title string resource according to the permission name.- Parameters:
permission
- The permission name.- Returns:
- The permission title string resource.
-
getPermissionSubtitle
Get permission subtitle string resource according to the permission name.- Parameters:
permission
- The permission name.- Returns:
- The permission subtitle string resource.
-