mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-14 02:01:56 +00:00
improve how warning shows
This commit is contained in:
parent
89ab3fc360
commit
6fdd75a20c
1 changed files with 7 additions and 6 deletions
|
|
@ -883,6 +883,9 @@ class TaskFormActivity : BaseActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkIfShowNotifLayout() {
|
private fun checkIfShowNotifLayout() {
|
||||||
|
|
||||||
|
val alarmManager = this.getSystemService(Context.ALARM_SERVICE) as? AlarmManager
|
||||||
|
var warnAboutInexact = false
|
||||||
if (!pushNotificationManager.notificationPermissionEnabled() && Build.VERSION.SDK_INT >= 33) {
|
if (!pushNotificationManager.notificationPermissionEnabled() && Build.VERSION.SDK_INT >= 33) {
|
||||||
binding.notificationsDisabledLayout.visibility = View.VISIBLE
|
binding.notificationsDisabledLayout.visibility = View.VISIBLE
|
||||||
binding.remindersContainer.shouldShowNotifPermission = true
|
binding.remindersContainer.shouldShowNotifPermission = true
|
||||||
|
|
@ -894,13 +897,11 @@ class TaskFormActivity : BaseActivity() {
|
||||||
} else {
|
} else {
|
||||||
binding.remindersContainer.shouldShowNotifPermission = false
|
binding.remindersContainer.shouldShowNotifPermission = false
|
||||||
binding.notificationsDisabledLayout.visibility = View.GONE
|
binding.notificationsDisabledLayout.visibility = View.GONE
|
||||||
}
|
|
||||||
|
|
||||||
val alarmManager = this.getSystemService(Context.ALARM_SERVICE) as? AlarmManager
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
var warnAboutInexact = false
|
if (alarmManager?.canScheduleExactAlarms() == false) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
warnAboutInexact = true
|
||||||
if (alarmManager?.canScheduleExactAlarms() == false) {
|
}
|
||||||
warnAboutInexact = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (warnAboutInexact) {
|
if (warnAboutInexact) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue