diff --git a/astrid/src/main/AndroidManifest.xml b/astrid/src/main/AndroidManifest.xml index 629aaaf9c..1806c4226 100644 --- a/astrid/src/main/AndroidManifest.xml +++ b/astrid/src/main/AndroidManifest.xml @@ -5,8 +5,8 @@ --> + android:versionName="4.6.13" + android:versionCode="327"> diff --git a/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderPreferences.java b/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderPreferences.java index 1e2e42bc1..0dc9692f7 100644 --- a/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderPreferences.java +++ b/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderPreferences.java @@ -8,7 +8,6 @@ package com.todoroo.astrid.reminders; import android.content.res.Resources; import android.preference.Preference; -import com.todoroo.andlib.utility.Preferences; import com.todoroo.andlib.utility.TodorooPreferenceActivity; import org.joda.time.DateTime; @@ -40,21 +39,13 @@ public class ReminderPreferences extends TodorooPreferenceActivity { preference.setSummary(""); } } else if(r.getString(R.string.p_rmd_quietStart).equals(preference.getKey())) { - if(Preferences.getBoolean(R.string.p_rmd_enable_quiet, false)) { - int millisOfDay = (int) value; - String setting = DateFormat.getTimeInstance(DateFormat.SHORT).format(new DateTime().withMillisOfDay(millisOfDay).toDate()); - preference.setSummary(r.getString(R.string.rmd_EPr_quiet_hours_start_desc, setting)); - } else { - preference.setSummary(r.getString(R.string.rmd_EPr_quiet_hours_desc_none)); - } + int millisOfDay = (int) value; + String setting = DateFormat.getTimeInstance(DateFormat.SHORT).format(new DateTime().withMillisOfDay(millisOfDay).toDate()); + preference.setSummary(r.getString(R.string.rmd_EPr_quiet_hours_start_desc, setting)); } else if(r.getString(R.string.p_rmd_quietEnd).equals(preference.getKey())) { - if(Preferences.getBoolean(R.string.p_rmd_enable_quiet, false)) { - int millisOfDay = (int) value; - String setting = DateFormat.getTimeInstance(DateFormat.SHORT).format(new DateTime().withMillisOfDay(millisOfDay).toDate()); - preference.setSummary(r.getString(R.string.rmd_EPr_quiet_hours_end_desc, setting)); - } else { - preference.setSummary(r.getString(R.string.rmd_EPr_quiet_hours_desc_none)); - } + int millisOfDay = (int) value; + String setting = DateFormat.getTimeInstance(DateFormat.SHORT).format(new DateTime().withMillisOfDay(millisOfDay).toDate()); + preference.setSummary(r.getString(R.string.rmd_EPr_quiet_hours_end_desc, setting)); } else if(r.getString(R.string.p_rmd_time).equals(preference.getKey())) { int millisOfDay = (int) value; String setting = DateFormat.getTimeInstance(DateFormat.SHORT).format(new DateTime().withMillisOfDay(millisOfDay).toDate()); diff --git a/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderService.java b/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderService.java index 88df20f3c..4b7271fcf 100644 --- a/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderService.java +++ b/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderService.java @@ -120,7 +120,6 @@ public final class ReminderService { Editor editor = prefs.edit(); Resources r = context.getResources(); - Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_enable_quiet, false); Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_default_random_hours, 0); Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_persistent, true); diff --git a/astrid/src/main/java/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java b/astrid/src/main/java/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java index 656261de9..fd17ae698 100644 --- a/astrid/src/main/java/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java +++ b/astrid/src/main/java/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java @@ -14,6 +14,7 @@ import com.todoroo.astrid.data.Task; import org.joda.time.DateTime; import org.tasks.R; +import static com.todoroo.andlib.utility.Preferences.setBoolean; import static com.todoroo.andlib.utility.Preferences.setIntIfUnset; public class AstridDefaultPreferenceSpec extends AstridPreferenceSpec { @@ -39,7 +40,7 @@ public class AstridDefaultPreferenceSpec extends AstridPreferenceSpec { Preferences.setInt(AstridPreferences.P_SUBTASKS_HELP, 1); } } - Preferences.setBoolean(dragDropTestInitialized, true); + setBoolean(dragDropTestInitialized, true); } BeastModePreferences.setDefaultOrder(context); } @@ -90,7 +91,8 @@ public class AstridDefaultPreferenceSpec extends AstridPreferenceSpec { setPreference(prefs, editor, r, R.string.p_hide_plus_button, true); - setPreference(prefs, editor, r, R.string.p_rmd_enable_quiet, true); + setPreference(prefs, editor, r, R.string.p_rmd_quietStart_old, 22); // enable quiet hours by default + setIntIfUnset(prefs, editor, r, R.string.p_rmd_quietStart, r.getInteger(R.integer.default_quiet_hours_start)); setIntIfUnset(prefs, editor, r, R.string.p_rmd_quietEnd, r.getInteger(R.integer.default_quiet_hours_end)); setIntIfUnset(prefs, editor, r, R.string.p_rmd_time, r.getInteger(R.integer.default_remind_time)); @@ -103,18 +105,12 @@ public class AstridDefaultPreferenceSpec extends AstridPreferenceSpec { } static void migrateToNewQuietHours() { - boolean hasMigrated = Preferences.getBoolean(R.string.p_rmd_hasMigrated, false); - - if(!hasMigrated) { - boolean quietHoursEnabled = Preferences.getIntegerFromString(R.string.p_rmd_quietStart_old, -1) >= 0; - Preferences.setBoolean(R.string.p_rmd_enable_quiet, quietHoursEnabled); - - if (quietHoursEnabled) { - setTime(R.string.p_rmd_quietStart_old, R.string.p_rmd_quietStart, 22); - setTime(R.string.p_rmd_quietEnd_old, R.string.p_rmd_quietEnd, 10); - } + if(!Preferences.getBoolean(R.string.p_rmd_hasMigrated, false)) { + setBoolean(R.string.p_rmd_enable_quiet, Preferences.getIntegerFromString(R.string.p_rmd_quietStart_old, -1) >= 0); + setTime(R.string.p_rmd_quietStart_old, R.string.p_rmd_quietStart, 22); + setTime(R.string.p_rmd_quietEnd_old, R.string.p_rmd_quietEnd, 10); setTime(R.string.p_rmd_time_old, R.string.p_rmd_time, 18); - Preferences.setBoolean(R.string.p_rmd_hasMigrated, true); + setBoolean(R.string.p_rmd_hasMigrated, true); } }