Easier to use Android runtime permissions with LiveData
implementation 'com.werb.azure:azure:0.3.0'
implementation 'android.arch.lifecycle:extensions:$last_version'
// support dynamic permissions and dangerous permissions
Azure(this)
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE, Settings.ACTION_MANAGE_OVERLAY_PERMISSION)
.subscribe {
if (it) {
// do something when permission isGranted
} else {
// do something when permission isDenied
}
}.request()