mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fix #34, remember last value inserted at reminder minutes
This commit is contained in:
@ -48,4 +48,12 @@ public class Config {
|
|||||||
public void setDisplayWeekNumbers(boolean displayWeekNumbers) {
|
public void setDisplayWeekNumbers(boolean displayWeekNumbers) {
|
||||||
mPrefs.edit().putBoolean(Constants.WEEK_NUMBERS, displayWeekNumbers).apply();
|
mPrefs.edit().putBoolean(Constants.WEEK_NUMBERS, displayWeekNumbers).apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getLastOtherReminderMins() {
|
||||||
|
return mPrefs.getInt(Constants.LAST_OTHER_REMINDER_MINS, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastOtherReminderMins(int lastMins) {
|
||||||
|
mPrefs.edit().putInt(Constants.LAST_OTHER_REMINDER_MINS, lastMins).apply();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,4 +21,5 @@ public class Constants {
|
|||||||
public static final String WEEK_NUMBERS = "week_numbers";
|
public static final String WEEK_NUMBERS = "week_numbers";
|
||||||
public static final String WIDGET_BG_COLOR = "widget_bg_color";
|
public static final String WIDGET_BG_COLOR = "widget_bg_color";
|
||||||
public static final String WIDGET_TEXT_COLOR = "widget_text_color";
|
public static final String WIDGET_TEXT_COLOR = "widget_text_color";
|
||||||
|
public static final String LAST_OTHER_REMINDER_MINS = "last_other_reminder_mins";
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,7 @@ class EventActivity : SimpleActivity(), DBHelper.DBOperationsListener {
|
|||||||
title = resources.getString(R.string.new_event)
|
title = resources.getString(R.string.new_event)
|
||||||
mEventStartDateTime = Formatter.getDateTimeFromCode(dayCode).withZoneRetainFields(DateTimeZone.getDefault()).withHourOfDay(13)
|
mEventStartDateTime = Formatter.getDateTimeFromCode(dayCode).withZoneRetainFields(DateTimeZone.getDefault()).withHourOfDay(13)
|
||||||
mEventEndDateTime = mEventStartDateTime
|
mEventEndDateTime = mEventStartDateTime
|
||||||
|
event_reminder_other.setText(mConfig.lastOtherReminderMins.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hideKeyboard() {
|
private fun hideKeyboard() {
|
||||||
@ -211,6 +212,14 @@ class EventActivity : SimpleActivity(), DBHelper.DBOperationsListener {
|
|||||||
} else {
|
} else {
|
||||||
dbHelper.update(mEvent)
|
dbHelper.update(mEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveLastReminderMins()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun saveLastReminderMins() {
|
||||||
|
if (event_reminder.selectedItemPosition == 2) {
|
||||||
|
mConfig.lastOtherReminderMins = reminderMinutes
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val reminderMinutes: Int
|
private val reminderMinutes: Int
|
||||||
|
Reference in New Issue
Block a user