A permission application library that supports injection permission instructions, based on RxPermission
- Single/multiple runtime permission requests are supported
- The permission for installing unknown applications is supported
- Jump to the permission setting page is supported
- Permission usage instructions view injection is supported
-
Add the JitPack repository to your build.gradle in the project root path
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
-
add the dependency to your build.gradle in the module path
dependencies { implementation 'com.github.DSAppTeam:DSPermission:v1.0.0' }
Sample:
PermissionManager.get()
.inject(context)
.request(new ResultCall() {
@Override
public void granted() {
Toast.makeText(context, "granted", Toast.LENGTH_LONG).show();
}
@Override
public void denied(boolean never) {
//nerver : 是否永不询问
Toast.makeText(context, "denied " + never, Toast.LENGTH_LONG).show();
}
}, new PermissionConfig.Builder()
//Request the permission to install the application, use the camera and microphone
.addPermission(Manifest.permission.REQUEST_INSTALL_PACKAGES)
.addPermission(Manifest.permission.CAMERA)
.addPermission(Manifest.permission.RECORD_AUDIO)
.build()
);
}
Effect:
- custom views is supported
Apache 2.0. See the License for details.