Class DynamicPermissionsView

All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent

public class DynamicPermissionsView extends DynamicRecyclerViewFrame
A FrameLayout containing a RecyclerView to show the list of required permissions.
  • Constructor Details

  • Method Details

    • getRecyclerViewLayoutManager

      @Nullable public RecyclerView.LayoutManager getRecyclerViewLayoutManager()
      Description copied from class: DynamicRecyclerViewFrame
      This method will be called to return the layout manager for the recycler view.

      Override this method to supply the layout manager during.

      Specified by:
      getRecyclerViewLayoutManager in class DynamicRecyclerViewFrame
      Returns:
      The layout manager for the recycler view.
    • setPermissions

      public void setPermissions(@NonNull List<DynamicPermission> permissions, @Nullable DynamicPermissionsView.PermissionListener permissionListener)
      Set the permissions to be shown by this view.

      Generally, it will be the required permissions to perform a particular action.

      Parameters:
      permissions - The permissions to be shown by this view.
      permissionListener - The listener to receive callback when a permission is selected.
    • getDynamicPermissions

      @NonNull public List<DynamicPermission> getDynamicPermissions()
      Returns a list of all the required permissions.
      Returns:
      A list of all the required permissions.
    • getDangerousPermissions

      @NonNull public String[] getDangerousPermissions()
      Get an array of all the dangerous permissions.
      Returns:
      An array of all the dangerous permissions.
    • getDangerousPermissionsLeft

      @NonNull public String[] getDangerousPermissionsLeft()
      Returns an array of unrequested or denied dangerous permissions.
      Returns:
      An array of unrequested or denied dangerous permissions.
    • getSpecialPermissionsLeft

      @NonNull public List<DynamicPermission> getSpecialPermissionsLeft()
      Returns a list of unrequested or denied special permissions.
      Returns:
      A list of unrequested or denied special permissions.
    • isAllPermissionsGranted

      public boolean isAllPermissionsGranted()
      Checks whether all the permissions shown by this view are granted.
      Returns:
      true if all the permissions shown by this view have been granted.
    • isUnknownPermissions

      public boolean isUnknownPermissions()
      Checks whether there is any unknown permission.
      Returns:
      true if there is any unknown permission shown by this view.
    • isPermissionsLeft

      public boolean isPermissionsLeft()
      Checks whether there is any permission left.
      Returns:
      true if there is any permission shown by this view has not been requested or denied.
    • isDangerousPermissionsLeft

      public boolean isDangerousPermissionsLeft()
      Checks whether there is any dangerous permission left.
      Returns:
      true if there is any dangerous permission shown by this view has not been requested or denied.
    • isSpecialPermissionsLeft

      public boolean isSpecialPermissionsLeft()
      Checks whether there is any special permission left.
      Returns:
      true if there is any special permission shown by this view has not been requested or denied.