Skip to content

Commit

Permalink
Use Integer.MIN_VALUE for preference "No Reminders" instead of -1
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitsaibot authored and jspricke committed Oct 27, 2023
1 parent abe5386 commit 710ecae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static String constructReminderLabel(Context context, int minutes, boolea
Resources resources = context.getResources();
int value, resId;

if (minutes < 0) {
if (minutes == Integer.MIN_VALUE) {
value = 0;
resId = R.string.no_reminder_label;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@ class GeneralPreferences : PreferenceFragmentCompat(),
const val KEY_ALERTS_POPUP = "preferences_alerts_popup"
const val KEY_SHOW_CONTROLS = "preferences_show_controls"
const val KEY_DEFAULT_REMINDER = "preferences_default_reminder"
const val NO_REMINDER = -1
const val NO_REMINDER_STRING = "-1"
const val NO_REMINDER = -2147483648
const val NO_REMINDER_STRING = "-2147483648"
const val REMINDER_DEFAULT_TIME = 10 // in minutes
const val KEY_USE_CUSTOM_SNOOZE_DELAY = "preferences_custom_snooze_delay"
const val KEY_DEFAULT_SNOOZE_DELAY = "preferences_default_snooze_delay"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</integer-array>

<string-array name="preferences_default_reminder_values" translatable="false">
<item>"-1"</item>
<item>"-2147483648"</item>
<item>"0"</item>
<item>"1"</item>
<item>"5"</item>
Expand Down

0 comments on commit 710ecae

Please sign in to comment.