Class DynamicPermissionUtils
java.lang.Object
com.pranavpandey.android.dynamic.support.util.DynamicPermissionUtils
Helper class to work with permissions and
DynamicPermission.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetPermissionIcon(String permission) Get permission icon drawable resource according to the permission name.static StringgetPermissionSettingsAction(String permission) Get permission settings action according to the permission name.static intgetPermissionSubtitle(String permission) Get permission subtitle string resource according to the permission name.static intgetPermissionTitle(String permission) Get permission title string resource according to the permission name.static booleanlaunchAppInfo(Context context) Launch app info by extracting the package name from the supplied context.static booleanopenPermissionSettings(Context context, String permission) Open the settings activity according to the permission name.static booleanopenPermissionSettings(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:
trueif 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:
trueif 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:
trueif 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.
-