Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to show the reminder option: "Never" correctly again #1485

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ public static String constructReminderLabel(Context context, int minutes, boolea
Resources resources = context.getResources();
int value, resId;

if (minutes % 60 != 0 || minutes == 0) {
if (minutes == Integer.MIN_VALUE) {
value = 0;
resId = R.string.no_reminder_label;

String format = resources.getString(resId, value);
return String.format(format, value);

} else if (minutes % 60 != 0 || minutes == 0) {
value = minutes;
if (abbrev) {
resId = R.plurals.Nmins;
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