From 0159fa448d5deb44f8261eba9c75f37715192799 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Jul 2023 15:02:59 +0200 Subject: [PATCH] updating commons --- app/build.gradle | 2 +- .../simplemobiletools/clock/adapters/TimerAdapter.kt | 2 +- .../simplemobiletools/clock/dialogs/EditAlarmDialog.kt | 2 +- .../simplemobiletools/clock/fragments/AlarmFragment.kt | 10 ++++++++-- .../clock/fragments/StopwatchFragment.kt | 5 ++++- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0e2614c7..18c5d756 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -64,7 +64,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:2d4e07e5f4' + implementation 'com.github.SimpleMobileTools:Simple-Commons:42733f39a4' implementation 'com.facebook.stetho:stetho:1.5.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'io.github.ShawnLin013:number-picker:2.4.13' diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/adapters/TimerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/clock/adapters/TimerAdapter.kt index e2c0fcc6..65ba8754 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/adapters/TimerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/adapters/TimerAdapter.kt @@ -130,7 +130,7 @@ class TimerAdapter( is TimerState.Finished -> EventBus.getDefault().post(TimerEvent.Start(timer.id!!, timer.seconds.secondsToMillis)) } } else { - PermissionRequiredDialog(activity, R.string.allow_notifications_reminders) + PermissionRequiredDialog(activity, R.string.allow_notifications_reminders, { activity.openNotificationSettings() }) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/EditAlarmDialog.kt b/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/EditAlarmDialog.kt index 7a5d1a18..d9ea6acd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/EditAlarmDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/EditAlarmDialog.kt @@ -171,7 +171,7 @@ class EditAlarmDialog(val activity: SimpleActivity, val alarm: Alarm, val callba callback(alarmId) alertDialog.dismiss() } else { - PermissionRequiredDialog(activity, R.string.allow_notifications_reminders) + PermissionRequiredDialog(activity, R.string.allow_notifications_reminders, { activity.openNotificationSettings() }) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/AlarmFragment.kt b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/AlarmFragment.kt index 690f9c74..817daae7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/AlarmFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/AlarmFragment.kt @@ -17,12 +17,15 @@ import com.simplemobiletools.clock.interfaces.ToggleAlarmInterface import com.simplemobiletools.clock.models.Alarm import com.simplemobiletools.commons.dialogs.PermissionRequiredDialog import com.simplemobiletools.commons.extensions.getProperTextColor +import com.simplemobiletools.commons.extensions.openNotificationSettings import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.commons.helpers.SORT_BY_DATE_CREATED import com.simplemobiletools.commons.helpers.ensureBackgroundThread import com.simplemobiletools.commons.models.AlarmSound -import kotlinx.android.synthetic.main.fragment_alarm.view.* +import kotlinx.android.synthetic.main.fragment_alarm.view.alarm_fab +import kotlinx.android.synthetic.main.fragment_alarm.view.alarm_fragment +import kotlinx.android.synthetic.main.fragment_alarm.view.alarms_list class AlarmFragment : Fragment(), ToggleAlarmInterface { private var alarms = ArrayList() @@ -135,7 +138,10 @@ class AlarmFragment : Fragment(), ToggleAlarmInterface { } requireContext().updateWidgets() } else { - PermissionRequiredDialog(activity as SimpleActivity, R.string.allow_notifications_reminders) + PermissionRequiredDialog( + activity as SimpleActivity, + R.string.allow_notifications_reminders, + { (activity as SimpleActivity).openNotificationSettings() }) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt index 57b52f68..02522842 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt @@ -129,7 +129,10 @@ class StopwatchFragment : Fragment() { if (granted) { Stopwatch.toggle(true) } else { - PermissionRequiredDialog(activity as SimpleActivity, R.string.allow_notifications_reminders) + PermissionRequiredDialog( + activity as SimpleActivity, + R.string.allow_notifications_reminders, + { (activity as SimpleActivity).openNotificationSettings() }) } } }