Framework to simplify android marshmallow permission support
Java
Latest commit 2e77f28 Nov 10, 2016 @anshulagarwal06 committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
.idea
app
gradle/wrapper
projectFilesBackup/.idea
simplifypermissions
.gitignore
README.md Update README.md Nov 10, 2016
Simplifygraphics.jpg
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

Simplify Permission

Simplify Android permission with in-build message Dialogs.

Feature

  • InBuild Rational Dialog with custom message
  • InBuild SettingScreen Dialog with custom Message.
  • Callback for permission state :
    • Permission granted
    • Permission removed
    • Permission access removed.

How to use

  • Extent Activity to MarshmallowSupportActivity
    public class MainActivity extends MarshmallowSupportActivity
  • Create PermissionBuilder.
            String[] CAMERA_PERMISSIONS = {Manifest.permission.CAMERA};

            PermissionBuilder permissionBuilder =
            new PermissionBuilder(CAMERA_PERMISSIONS,REQUEST_CARMERA, mPermissionCallback);
            .enableDefaultRationalDialog("Ration dialog title", "Ration Dialog message")
            .enableDefaultSettingDialog("Setting Dialog title", "Setting dialog message");

  • Call requestAppPermissions(permissionBuilder.build())
            requestAppPermissions(permissionBuilder.build());
  • Handle Permission callBacks
    private mPermissionCallback = new PermissionCallback(){

        @Override
        public void onPermissionGranted(int requestCode) {

        }

        @Override
        public void onPermissionDenied(int requestCode) {

        }

        @Override
        public void onPermissionAccessRemoved(int requestCode) {

        }
    }

Download

Include jitpack.io inside of root project build.gradle:

allprojects {
        repositories {
            ...
            maven { url "https://jitpack.io" }
        }
    }

After that you can easily include the library in your app build.gradle:

dependencies {
            compile 'com.github.anshulagarwal06:Simplify-Permissions:v1'
    }

That's it. build your project.