Skip to content

babedev/Dexter-DSL

Repository files navigation

Dexter DSL

Download Build Status

Dexter runtime permission with Kotlin DSL style

Download

repositories {
  ..
  maven { url "https://dl.bintray.com/babedev/maven" }
  ..
}

dependencies {
  ..
  compile 'com.github.babedev.dexter.dsl:dsl:1.0.3'
  ..
}

Sample

runtimePermission {
    permission(Manifest.permission.READ_EXTERNAL_STORAGE) {
        granted {
            toast("Permission granted")
        }

        denied {
            toast("Permission denied")
        }

        rationaleShouldBeShown { _, token ->
            token.continuePermissionRequest()
        }
    }
}

Libraries used in this project