diff --git a/app/build.gradle b/app/build.gradle
index 67d184b1..c5256016 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -67,16 +67,17 @@ android {
}
dependencies {
- implementation 'com.github.SimpleMobileTools:Simple-Commons:eee4809d37'
+ implementation 'com.github.SimpleMobileTools:Simple-Commons:d5e1100f27'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.shawnlin:number-picker:2.4.6'
- implementation "androidx.preference:preference-ktx:1.1.1"
- implementation "androidx.work:work-runtime-ktx:2.6.0"
+ implementation "androidx.preference:preference-ktx:1.2.0"
+ implementation "androidx.work:work-runtime-ktx:2.7.1"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
- implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
- implementation 'org.greenrobot:eventbus:3.2.0'
+ implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
+ implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
- implementation 'androidx.room:room-runtime:2.3.0'
- kapt 'androidx.room:room-compiler:2.3.0'
+
+ implementation 'androidx.room:room-runtime:2.4.2'
+ kapt 'androidx.room:room-compiler:2.4.2'
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 74a56d26..a9a5964a 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -7,6 +7,7 @@
+
0) {
if (activity.config.wasAlarmWarningShown) {
diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/adapters/SelectTimeZonesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/clock/adapters/SelectTimeZonesAdapter.kt
index de1098d0..10c08f8a 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/adapters/SelectTimeZonesAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/adapters/SelectTimeZonesAdapter.kt
@@ -7,15 +7,16 @@ import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.SimpleActivity
import com.simplemobiletools.clock.extensions.config
import com.simplemobiletools.clock.models.MyTimeZone
-import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
+import com.simplemobiletools.commons.extensions.getProperBackgroundColor
+import com.simplemobiletools.commons.extensions.getProperPrimaryColor
+import com.simplemobiletools.commons.extensions.getProperTextColor
import kotlinx.android.synthetic.main.item_add_time_zone.view.*
-import java.util.*
class SelectTimeZonesAdapter(val activity: SimpleActivity, val timeZones: ArrayList) : RecyclerView.Adapter() {
private val config = activity.config
- private val textColor = config.textColor
- private val backgroundColor = config.backgroundColor
- private val primaryColor = activity.getAdjustedPrimaryColor()
+ private val textColor = activity.getProperTextColor()
+ private val backgroundColor = activity.getProperBackgroundColor()
+ private val primaryColor = activity.getProperPrimaryColor()
var selectedKeys = HashSet()
init {
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 e457b7bb..9a332d3b 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/EditAlarmDialog.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/EditAlarmDialog.kt
@@ -19,11 +19,10 @@ import com.simplemobiletools.commons.dialogs.SelectAlarmSoundDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.models.AlarmSound
import kotlinx.android.synthetic.main.dialog_edit_alarm.view.*
-import java.util.*
class EditAlarmDialog(val activity: SimpleActivity, val alarm: Alarm, val callback: (alarmId: Int) -> Unit) {
private val view = activity.layoutInflater.inflate(R.layout.dialog_edit_alarm, null)
- private val textColor = activity.config.textColor
+ private val textColor = activity.getProperTextColor()
init {
restoreLastAlarm()
@@ -33,7 +32,7 @@ class EditAlarmDialog(val activity: SimpleActivity, val alarm: Alarm, val callba
edit_alarm_time.setOnClickListener {
TimePickerDialog(
context,
- context.getDialogTheme(),
+ context.getTimePickerDialogTheme(),
timeSetListener,
alarm.timeInMinutes / 60,
alarm.timeInMinutes % 60,
@@ -82,7 +81,7 @@ class EditAlarmDialog(val activity: SimpleActivity, val alarm: Alarm, val callba
val isDayChecked = alarm.days > 0 && alarm.days and pow != 0
day.background = getProperDayDrawable(isDayChecked)
- day.setTextColor(if (isDayChecked) context.config.backgroundColor else textColor)
+ day.setTextColor(if (isDayChecked) context.getProperBackgroundColor() else textColor)
day.setOnClickListener {
if (alarm.days < 0) {
alarm.days = 0
@@ -95,7 +94,7 @@ class EditAlarmDialog(val activity: SimpleActivity, val alarm: Alarm, val callba
alarm.days = alarm.days.removeBit(pow)
}
day.background = getProperDayDrawable(selectDay)
- day.setTextColor(if (selectDay) context.config.backgroundColor else textColor)
+ day.setTextColor(if (selectDay) context.getProperBackgroundColor() else textColor)
checkDaylessAlarm()
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/EditTimerDialog.kt b/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/EditTimerDialog.kt
index 7e792786..e74acb0c 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/EditTimerDialog.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/EditTimerDialog.kt
@@ -15,7 +15,7 @@ import kotlinx.android.synthetic.main.dialog_edit_timer.view.*
class EditTimerDialog(val activity: SimpleActivity, val timer: Timer, val callback: () -> Unit) {
private val view = activity.layoutInflater.inflate(R.layout.dialog_edit_timer, null)
- private val textColor = activity.config.textColor
+ private val textColor = activity.getProperTextColor()
init {
restoreLastAlarm()
diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/MyTimePickerDialogDialog.kt b/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/MyTimePickerDialogDialog.kt
index 052bbb54..06156793 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/MyTimePickerDialogDialog.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/dialogs/MyTimePickerDialogDialog.kt
@@ -3,7 +3,7 @@ package com.simplemobiletools.clock.dialogs
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.SimpleActivity
-import com.simplemobiletools.clock.extensions.config
+import com.simplemobiletools.commons.extensions.getProperTextColor
import com.simplemobiletools.commons.extensions.setupDialogStuff
import kotlinx.android.synthetic.main.dialog_my_time_picker.view.*
@@ -12,7 +12,7 @@ class MyTimePickerDialogDialog(val activity: SimpleActivity, val initialSeconds:
init {
view.apply {
- val textColor = activity.config.textColor
+ val textColor = activity.getProperTextColor()
arrayOf(my_time_picker_hours, my_time_picker_minutes, my_time_picker_seconds).forEach {
it.textColor = textColor
it.selectedTextColor = textColor
@@ -25,11 +25,11 @@ class MyTimePickerDialogDialog(val activity: SimpleActivity, val initialSeconds:
}
AlertDialog.Builder(activity)
- .setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
- .setNegativeButton(R.string.cancel, null)
- .create().apply {
- activity.setupDialogStuff(view, this)
- }
+ .setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
+ .setNegativeButton(R.string.cancel, null)
+ .create().apply {
+ activity.setupDialogStuff(view, this)
+ }
}
private fun dialogConfirmed() {
diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt
index 01b37003..ed7bcb0e 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt
@@ -140,20 +140,20 @@ fun Context.setupAlarmClock(alarm: Alarm, triggerInSeconds: Int) {
fun Context.getOpenAlarmTabIntent(): PendingIntent {
val intent = getLaunchIntent() ?: Intent(this, SplashActivity::class.java)
intent.putExtra(OPEN_TAB, TAB_ALARM)
- return PendingIntent.getActivity(this, OPEN_ALARMS_TAB_INTENT_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT)
+ return PendingIntent.getActivity(this, OPEN_ALARMS_TAB_INTENT_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
fun Context.getOpenTimerTabIntent(timerId: Int): PendingIntent {
val intent = getLaunchIntent() ?: Intent(this, SplashActivity::class.java)
intent.putExtra(OPEN_TAB, TAB_TIMER)
intent.putExtra(TIMER_ID, timerId)
- return PendingIntent.getActivity(this, timerId, intent, PendingIntent.FLAG_UPDATE_CURRENT)
+ return PendingIntent.getActivity(this, timerId, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
fun Context.getAlarmIntent(alarm: Alarm): PendingIntent {
val intent = Intent(this, AlarmReceiver::class.java)
intent.putExtra(ALARM_ID, alarm.id)
- return PendingIntent.getBroadcast(this, alarm.id, intent, PendingIntent.FLAG_UPDATE_CURRENT)
+ return PendingIntent.getBroadcast(this, alarm.id, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
fun Context.cancelAlarmClock(alarm: Alarm) {
@@ -189,7 +189,7 @@ fun Context.scheduleNextWidgetUpdate() {
}
val intent = Intent(this, DateTimeWidgetUpdateReceiver::class.java)
- val pendingIntent = PendingIntent.getBroadcast(this, UPDATE_WIDGET_INTENT_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT)
+ val pendingIntent = PendingIntent.getBroadcast(this, UPDATE_WIDGET_INTENT_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
val triggerAtMillis = System.currentTimeMillis() + getMSTillNextMinute()
@@ -294,7 +294,7 @@ fun Context.getTimerNotification(timer: Timer, pendingIntent: PendingIntent, add
NotificationChannel(channelId, name, importance).apply {
setBypassDnd(true)
enableLights(true)
- lightColor = getAdjustedPrimaryColor()
+ lightColor = getProperPrimaryColor()
setSound(Uri.parse(soundUri), audioAttributes)
if (!timer.vibrate) {
@@ -339,13 +339,13 @@ fun Context.getTimerNotification(timer: Timer, pendingIntent: PendingIntent, add
fun Context.getHideTimerPendingIntent(timerId: Int): PendingIntent {
val intent = Intent(this, HideTimerReceiver::class.java)
intent.putExtra(TIMER_ID, timerId)
- return PendingIntent.getBroadcast(this, timerId, intent, PendingIntent.FLAG_UPDATE_CURRENT)
+ return PendingIntent.getBroadcast(this, timerId, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
fun Context.getHideAlarmPendingIntent(alarm: Alarm): PendingIntent {
val intent = Intent(this, HideAlarmReceiver::class.java)
intent.putExtra(ALARM_ID, alarm.id)
- return PendingIntent.getBroadcast(this, alarm.id, intent, PendingIntent.FLAG_UPDATE_CURRENT)
+ return PendingIntent.getBroadcast(this, alarm.id, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
fun Context.getAlarmNotification(pendingIntent: PendingIntent, alarm: Alarm): Notification {
@@ -369,7 +369,7 @@ fun Context.getAlarmNotification(pendingIntent: PendingIntent, alarm: Alarm): No
NotificationChannel(channelId, label, importance).apply {
setBypassDnd(true)
enableLights(true)
- lightColor = getAdjustedPrimaryColor()
+ lightColor = getProperPrimaryColor()
enableVibration(alarm.vibrate)
setSound(Uri.parse(soundUri), audioAttributes)
notificationManager.createNotificationChannel(this)
@@ -411,15 +411,15 @@ fun Context.getSnoozePendingIntent(alarm: Alarm): PendingIntent {
val intent = Intent(this, snoozeClass).setAction("Snooze")
intent.putExtra(ALARM_ID, alarm.id)
return if (config.useSameSnooze) {
- PendingIntent.getService(this, alarm.id, intent, PendingIntent.FLAG_UPDATE_CURRENT)
+ PendingIntent.getService(this, alarm.id, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
} else {
- PendingIntent.getActivity(this, alarm.id, intent, PendingIntent.FLAG_UPDATE_CURRENT)
+ PendingIntent.getActivity(this, alarm.id, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
}
fun Context.getReminderActivityIntent(): PendingIntent {
val intent = Intent(this, ReminderActivity::class.java)
- return PendingIntent.getActivity(this, REMINDER_ACTIVITY_INTENT_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT)
+ return PendingIntent.getActivity(this, REMINDER_ACTIVITY_INTENT_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
fun Context.checkAlarmsWithDeletedSoundUri(uri: String) {
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 df86c333..905d689d 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/AlarmFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/AlarmFragment.kt
@@ -15,12 +15,12 @@ import com.simplemobiletools.clock.extensions.*
import com.simplemobiletools.clock.helpers.*
import com.simplemobiletools.clock.interfaces.ToggleAlarmInterface
import com.simplemobiletools.clock.models.Alarm
+import com.simplemobiletools.commons.extensions.getProperTextColor
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.commons.models.AlarmSound
import kotlinx.android.synthetic.main.fragment_alarm.view.*
-import java.util.*
class AlarmFragment : Fragment(), ToggleAlarmInterface {
private var alarms = ArrayList()
@@ -40,7 +40,7 @@ class AlarmFragment : Fragment(), ToggleAlarmInterface {
super.onResume()
setupViews()
- val configTextColor = requireContext().config.textColor
+ val configTextColor = requireContext().getProperTextColor()
if (storedTextColor != configTextColor) {
(view.alarms_list.adapter as AlarmsAdapter).updateTextColor(configTextColor)
}
@@ -58,7 +58,7 @@ class AlarmFragment : Fragment(), ToggleAlarmInterface {
}
private fun storeStateVariables() {
- storedTextColor = requireContext().config.textColor
+ storedTextColor = requireContext().getProperTextColor()
}
private fun setupViews() {
diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/ClockFragment.kt b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/ClockFragment.kt
index 9648d2ff..7664839e 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/ClockFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/ClockFragment.kt
@@ -15,6 +15,7 @@ import com.simplemobiletools.clock.extensions.*
import com.simplemobiletools.clock.helpers.getPassedSeconds
import com.simplemobiletools.clock.models.MyTimeZone
import com.simplemobiletools.commons.extensions.beVisibleIf
+import com.simplemobiletools.commons.extensions.getProperTextColor
import com.simplemobiletools.commons.extensions.updateTextColors
import kotlinx.android.synthetic.main.fragment_clock.view.*
import java.util.*
@@ -40,7 +41,7 @@ class ClockFragment : Fragment() {
super.onResume()
setupDateTime()
- val configTextColor = requireContext().config.textColor
+ val configTextColor = requireContext().getProperTextColor()
if (storedTextColor != configTextColor) {
(view.time_zones_list.adapter as? TimeZonesAdapter)?.updateTextColor(configTextColor)
}
@@ -53,7 +54,7 @@ class ClockFragment : Fragment() {
}
private fun storeStateVariables() {
- storedTextColor = requireContext().config.textColor
+ storedTextColor = requireContext().getProperTextColor()
}
private fun setupDateTime() {
@@ -112,7 +113,7 @@ class ClockFragment : Fragment() {
val nextAlarm = requireContext().getNextAlarm()
clock_alarm.beVisibleIf(nextAlarm.isNotEmpty())
clock_alarm.text = nextAlarm
- clock_alarm.colorCompoundDrawable(requireContext().config.textColor)
+ clock_alarm.colorCompoundDrawable(requireContext().getProperTextColor())
}
}
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 b2dc7b6d..65b143ab 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt
@@ -120,7 +120,7 @@ class StopwatchFragment : Fragment() {
super.onResume()
setupViews()
- val configTextColor = requireContext().config.textColor
+ val configTextColor = requireContext().getProperTextColor()
if (storedTextColor != configTextColor) {
stopwatchAdapter.updateTextColor(configTextColor)
}
@@ -141,7 +141,7 @@ class StopwatchFragment : Fragment() {
}
private fun storeStateVariables() {
- storedTextColor = requireContext().config.textColor
+ storedTextColor = requireContext().getProperTextColor()
}
override fun onSaveInstanceState(outState: Bundle) {
@@ -183,11 +183,11 @@ class StopwatchFragment : Fragment() {
}
private fun setupViews() {
- val adjustedPrimaryColor = requireContext().getAdjustedPrimaryColor()
+ val properPrimaryColor = requireContext().getProperPrimaryColor()
view.apply {
requireContext().updateTextColors(stopwatch_fragment)
- stopwatch_play_pause.background = resources.getColoredDrawableWithColor(R.drawable.circle_background_filled, adjustedPrimaryColor)
- stopwatch_reset.applyColorFilter(requireContext().config.textColor)
+ stopwatch_play_pause.background = resources.getColoredDrawableWithColor(R.drawable.circle_background_filled, properPrimaryColor)
+ stopwatch_reset.applyColorFilter(requireContext().getProperTextColor())
}
updateIcons()
@@ -196,7 +196,7 @@ class StopwatchFragment : Fragment() {
private fun updateIcons() {
val drawableId = if (isRunning) R.drawable.ic_pause_vector else R.drawable.ic_play_vector
- val iconColor = if (requireContext().getAdjustedPrimaryColor() == Color.WHITE) Color.BLACK else Color.WHITE
+ val iconColor = if (requireContext().getProperPrimaryColor() == Color.WHITE) Color.BLACK else Color.WHITE
view.stopwatch_play_pause.setImageDrawable(resources.getColoredDrawableWithColor(drawableId, iconColor))
}
@@ -267,7 +267,7 @@ class StopwatchFragment : Fragment() {
}
private fun updateSortingIndicators() {
- var bitmap = requireContext().resources.getColoredBitmap(R.drawable.ic_sorting_triangle_vector, requireContext().getAdjustedPrimaryColor())
+ var bitmap = requireContext().resources.getColoredBitmap(R.drawable.ic_sorting_triangle_vector, requireContext().getProperPrimaryColor())
view.apply {
stopwatch_sorting_indicator_1.beInvisibleIf(sorting and SORT_BY_LAP == 0)
stopwatch_sorting_indicator_2.beInvisibleIf(sorting and SORT_BY_LAP_TIME == 0)
diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt
index 2ff94139..678e4092 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt
@@ -17,6 +17,7 @@ import com.simplemobiletools.clock.extensions.timerHelper
import com.simplemobiletools.clock.helpers.DisabledItemChangeAnimator
import com.simplemobiletools.clock.models.Timer
import com.simplemobiletools.clock.models.TimerEvent
+import com.simplemobiletools.commons.extensions.getProperTextColor
import com.simplemobiletools.commons.extensions.hideKeyboard
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.models.AlarmSound
@@ -77,7 +78,7 @@ class TimerFragment : Fragment() {
override fun onResume() {
super.onResume()
requireContext().updateTextColors(timer_fragment)
- val configTextColor = requireContext().config.textColor
+ val configTextColor = requireContext().getProperTextColor()
if (storedTextColor != configTextColor) {
initAdapter()
timerAdapter.updateTextColor(configTextColor)
@@ -108,7 +109,7 @@ class TimerFragment : Fragment() {
}
private fun storeStateVariables() {
- storedTextColor = requireContext().config.textColor
+ storedTextColor = requireContext().getProperTextColor()
}
@Subscribe(threadMode = ThreadMode.MAIN)
diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/MyWidgetDateTimeProvider.kt b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/MyWidgetDateTimeProvider.kt
index 89128df9..fa5fa20c 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/MyWidgetDateTimeProvider.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/MyWidgetDateTimeProvider.kt
@@ -90,7 +90,7 @@ class MyWidgetDateTimeProvider : AppWidgetProvider() {
private fun setupAppOpenIntent(context: Context, views: RemoteViews) {
(context.getLaunchIntent() ?: Intent(context, SplashActivity::class.java)).apply {
putExtra(OPEN_TAB, TAB_CLOCK)
- val pendingIntent = PendingIntent.getActivity(context, OPEN_APP_INTENT_ID, this, PendingIntent.FLAG_UPDATE_CURRENT)
+ val pendingIntent = PendingIntent.getActivity(context, OPEN_APP_INTENT_ID, this, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
views.setOnClickPendingIntent(R.id.widget_date_time_holder, pendingIntent)
}
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/receivers/AlarmReceiver.kt b/app/src/main/kotlin/com/simplemobiletools/clock/receivers/AlarmReceiver.kt
index 8ce05c83..f7572713 100644
--- a/app/src/main/kotlin/com/simplemobiletools/clock/receivers/AlarmReceiver.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/clock/receivers/AlarmReceiver.kt
@@ -48,7 +48,7 @@ class AlarmReceiver : BroadcastReceiver() {
val pendingIntent = PendingIntent.getActivity(context, 0, Intent(context, ReminderActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
putExtra(ALARM_ID, id)
- }, PendingIntent.FLAG_UPDATE_CURRENT)
+ }, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
val builder = NotificationCompat.Builder(context, "Alarm")
.setSmallIcon(R.drawable.ic_alarm_vector)