Git Product home page Git Product logo

heipermission's Introduction

HeiPermission

Android M 动态权限解决方案,Let You Fly!

License Hex.pm Logo

Demo_APK下载

动图(相信你会Star的)

使用方式

  1. 导入permlib到Project中,app添加库依赖。(建议拷贝源码,可根据需求定制)

  2. 奇淫技巧:

    checkPermission(CheckPermListener listener, int resString, String... mPerms)
    
    	- listener:	权限全部通过接口回调,只检测没有后续行为可 null
    	- resString:	权限用途的说明提示(引导用户开启权限)
    	- mPerms:	申请的高危权限组(可同时申请多个)
    
  3. 下面列出简单的使用方法

Activity中:

首先需要检测权限的 Activity extends PermissionActivity

checkPermission(new CheckPermListener() {
                @Override
                public void superPermission() {
                   TODO : 需要权限去完成的功能
                }
            },R.string.camera, 
            Manifest.permission.CAMERA,
            Manifest.permission.WRITE_EXTERNAL_STORAGE);

Fragment中:

 首先Fragment依存的 Activity extends PermissionActivit

((PermissionActivity)getActivity()).checkPermission(
	new PermissionActivity.CheckPermListener() {
        @Override
        public void superPermission() {
             TODO : 需要权限去完成的功能
        }
    },R.string.camera, Manifest.permission.CAMERA);

感谢开源库

EasyPermissions

联系作者

邮箱:[email protected] #License

Copyright 2016 forJrking

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

heipermission's People

Contributors

forjrking avatar

Watchers

 avatar  avatar

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.