Dexter runtime permission with Kotlin DSL style
repositories {
..
maven { url "https://dl.bintray.com/babedev/maven" }
..
}
dependencies {
..
compile 'com.github.babedev.dexter.dsl:dsl:1.0.3'
..
}
runtimePermission {
permission(Manifest.permission.READ_EXTERNAL_STORAGE) {
granted {
toast("Permission granted")
}
denied {
toast("Permission denied")
}
rationaleShouldBeShown { _, token ->
token.continuePermissionRequest()
}
}
}