Package 

Class Permissions


  • 
    public class Permissions
    
                        
    Helper class for handling runtime permissions.
    Created on 6/11/2017 on 9:32 PM
    
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class Permissions.Options

      Options to customize while requesting permissions.

    • Method Summary

      Modifier and Type Method Description
      static void disableLogging() Disable logs.
      static void check(Context context, String permission, String rationale, PermissionHandler handler) Check/Request a permission and call the callback methods of permission handler accordingly.
      static void check(Context context, String permission, int rationaleId, PermissionHandler handler) Check/Request a permission and call the callback methods of permission handler accordingly.
      static void check(Context context, Array<String> permissions, String rationale, Permissions.Options options, PermissionHandler handler) Check/Request permissions and call the callback methods of permission handler accordingly.
      static void check(Context context, Array<String> permissions, int rationaleId, Permissions.Options options, PermissionHandler handler) Check/Request permissions and call the callback methods of permission handler accordingly.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • check

         static void check(Context context, String permission, String rationale, PermissionHandler handler)

        Check/Request a permission and call the callback methods of permission handler accordingly.

        Parameters:
        context - the android context.
        permission - the permission to be requested.
        rationale - Explanation to be shown to user if s/he has denied permission earlier.If this parameter is null, permissions will be requested without showingthe rationale dialog.
        handler - The permission handler object for handling callbacks of various useractions such as permission granted, permission denied, etc.
      • check

         static void check(Context context, String permission, int rationaleId, PermissionHandler handler)

        Check/Request a permission and call the callback methods of permission handler accordingly.

        Parameters:
        context - the android context.
        permission - the permission to be requested.
        rationaleId - The string resource id of the explanation to be shown to user if s/he hasdenied permission earlier.
        handler - The permission handler object for handling callbacks of various useractions such as permission granted, permission denied, etc.
      • check

         static void check(Context context, Array<String> permissions, String rationale, Permissions.Options options, PermissionHandler handler)

        Check/Request permissions and call the callback methods of permission handler accordingly.

        Parameters:
        context - Android context.
        permissions - The array of one or more permission(s) to request.
        rationale - Explanation to be shown to user if s/he has denied permission earlier.If this parameter is null, permissions will be requested without showingthe rationale dialog.
        options - The options for handling permissions.
        handler - The permission handler object for handling callbacks of various useractions such as permission granted, permission denied, etc.
      • check

         static void check(Context context, Array<String> permissions, int rationaleId, Permissions.Options options, PermissionHandler handler)

        Check/Request permissions and call the callback methods of permission handler accordingly.

        Parameters:
        context - Android context.
        permissions - The array of one or more permission(s) to request.
        rationaleId - The string resource id of the explanation to be shown to user if s/he hasdenied permission earlier.
        options - The options for handling permissions.
        handler - The permission handler object for handling callbacks of various useractions such as permission granted, permission denied, etc.