Nat Strangerweather
09/26/2020, 5:25 PMfun checkNotificationPolicyAccess(
notificationManager: NotificationManager,
context: Context
): Boolean {
if (notificationManager.isNotificationPolicyAccessGranted) {
Toast.makeText(context, "Notification policy access granted.", Toast.LENGTH_SHORT).show()
return true
} else {
// add dialog here
}
return false
}
How can I do that? The composable looks like this:
@Composable
fun NotificationPolicyPermissionDialog() {
val openDialog = remember { mutableStateOf(true) }
Dialog(onDismissRequest = { openDialog.value = false }) {
Box(Modifier.preferredSize(100.dp, 100.dp), backgroundColor = Color.White)
}
}
Brian Beale
09/26/2020, 6:10 PMNat Strangerweather
09/26/2020, 6:29 PMBrian Beale
09/26/2020, 6:35 PM