POWER PERMISSIONS TO RUN TIME

PowerPermission makes handling runtime permissions extremely easy

PowerPermission

PowerPermission is a library to simplify process of demanding RuntimePermission.

You find an example application in this Repo or downloading directly here.
Here are some different points compare with other libraries:

    • support asking permissions in AppCompatActivity and Fragment(include ChildFragment)
    • support custom rational view after user refuse permission
  • support ability to choose permissions to display rational views
  • support different interface (RxJava2,RxJava3,Coroutines,LiveData)

example

How to Download

Basic

Groovy

Other API Support

Groovy

OverView

PACKAGE NAMEROLEUSAGE
powerpermissionBasic core packageimplementation “com.qifan.powerpermission:powerpermission:1.0.0”
powerpermission-rxjava2Support RxJava2implementation “com.qifan.powerpermission:powerpermission-rxjava2:1.0.0”
powerpermission-rxjava3Support RxJava3implementation “com.qifan.powerpermission:powerpermission-rxjava3:1.0.0”
powerpermission-coroutinesSupport Kotlin Coroutineimplementation “com.qifan.powerpermission:powerpermission-coroutines:1.0.0”
powerpermission-livedataSupport Android LiveDataimplementation “com.qifan.powerpermission:powerpermission-livedata:1.0.0”

How to use

Simple Usage

Singleton

Kotlin

Extension

  • Require in Activity
Kotlin
  • Require in Fragment
Kotlin
  • Require in ChildFragment
Kotlin

RxJava/RxKotlin

Basic Usage

Kotlin

Use with RxBinding

Kotlin

Coroutine

Kotlin

Livedata

Kotlin

Rationale Interface

Custom View

In PowerPermission it have a interface which called RationaleDelegate, it should be used as bridge to create your proper
delegation class to implement this interface.
It provide two basic public declaration functions,

  • displayRationale
Kotlin
  • onDismissView
Kotlin

PS: PowerPermission has already provided a class called DialogRationaleDelegate.kt to display a classic dialog view you can take a look at it and find more inspiration.

Choose those permissions are rational

  • RationaleData
    It’s a data class used as choose which permission or permissions to display rationale view.
    And what kind of message will be displayed in your rational view.
    example:
(Visited 21 times, 1 visits today)

You May Also Like

About the Author: Android Developer

This is Mohammad I am Android Application Developer. I am the founder of Android Tutorial Online blog. I am programming lover and professional blogger from India. I spend most of my time doing programming and helping other programmers. This Android tutorial online blog for learning and share Android code.
My Chatbot
Powered by Replace Me