mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
Properly open settings for full screen notifications
This commit is contained in:
@ -1,9 +1,11 @@
|
|||||||
package com.simplemobiletools.clock.extensions
|
package com.simplemobiletools.clock.extensions
|
||||||
|
|
||||||
|
import com.simplemobiletools.clock.BuildConfig
|
||||||
import com.simplemobiletools.clock.R
|
import com.simplemobiletools.clock.R
|
||||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||||
import com.simplemobiletools.commons.dialogs.PermissionRequiredDialog
|
import com.simplemobiletools.commons.dialogs.PermissionRequiredDialog
|
||||||
import com.simplemobiletools.commons.extensions.canUseFullScreenIntent
|
import com.simplemobiletools.commons.extensions.canUseFullScreenIntent
|
||||||
|
import com.simplemobiletools.commons.extensions.openFullScreenIntentSettings
|
||||||
|
|
||||||
fun BaseSimpleActivity.handleFullScreenNotificationsPermission(callback: (granted: Boolean) -> Unit) {
|
fun BaseSimpleActivity.handleFullScreenNotificationsPermission(callback: (granted: Boolean) -> Unit) {
|
||||||
handleNotificationPermission { granted ->
|
handleNotificationPermission { granted ->
|
||||||
@ -15,7 +17,7 @@ fun BaseSimpleActivity.handleFullScreenNotificationsPermission(callback: (grante
|
|||||||
activity = this,
|
activity = this,
|
||||||
textId = R.string.allow_full_screen_notifications_reminders,
|
textId = R.string.allow_full_screen_notifications_reminders,
|
||||||
positiveActionCallback = {
|
positiveActionCallback = {
|
||||||
callback(true)
|
openFullScreenIntentSettings(BuildConfig.APPLICATION_ID)
|
||||||
},
|
},
|
||||||
negativeActionCallback = {
|
negativeActionCallback = {
|
||||||
// It is not critical to have full screen intents, so we should allow users to continue using the app
|
// It is not critical to have full screen intents, so we should allow users to continue using the app
|
||||||
|
Reference in New Issue
Block a user