Giter Site home page Giter Site logo

dspermission's Introduction

A permission application library that supports injection permission instructions, based on RxPermission

README: English | 中文

Introduction

Function

  • 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

Setup

  1. Add the JitPack repository to your build.gradle in the project root path

     allprojects {
         repositories {
             ...
             maven { url 'https://jitpack.io' }
         }
     }
    
  2. add the dependency to your build.gradle in the module path

    dependencies {
            implementation 'com.github.DSAppTeam:DSPermission:v1.0.0'
    }
    

Usage

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:

申请相机权限

申请麦克风权限

申请安装应用程序权限

TODO

  • custom views is supported

License

Apache 2.0. See the License for details.

Welcome to mention the functions and issues what you need

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.