From 3b5fca0d6786948ab5b0e8e5ebb99ceba9317489 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Thu, 17 Jan 2013 15:48:58 -0800 Subject: [PATCH] AB test the simple edit box style --- .../com/todoroo/astrid/service/UpgradeService.java | 4 ---- .../com/todoroo/astrid/service/abtesting/ABTests.java | 11 ++++++++++- .../astrid/utility/AstridDefaultPreferenceSpec.java | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/astrid/src/com/todoroo/astrid/service/UpgradeService.java b/astrid/src/com/todoroo/astrid/service/UpgradeService.java index 55bcf71ba..118d73e32 100644 --- a/astrid/src/com/todoroo/astrid/service/UpgradeService.java +++ b/astrid/src/com/todoroo/astrid/service/UpgradeService.java @@ -264,10 +264,6 @@ public final class UpgradeService { Preferences.setString(R.string.p_taskRowStyle_v2, value ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$ } } - - if (from < V4_5_2) { - Preferences.setBoolean(R.string.p_simple_input_boxes, true); - } } /** diff --git a/astrid/src/com/todoroo/astrid/service/abtesting/ABTests.java b/astrid/src/com/todoroo/astrid/service/abtesting/ABTests.java index 6c22ac019..44a8cb74c 100644 --- a/astrid/src/com/todoroo/astrid/service/abtesting/ABTests.java +++ b/astrid/src/com/todoroo/astrid/service/abtesting/ABTests.java @@ -38,6 +38,10 @@ public class ABTests { if (!Constants.ASTRID_LITE && ABChooser.readChoiceForTest(AB_USE_DATE_SHORTCUTS) == ABChooser.NO_OPTION) { Preferences.clear(context.getString(R.string.p_use_date_shortcuts)); } + + if (!Constants.ASTRID_LITE && ABChooser.readChoiceForTest(AB_SIMPLE_EDIT_BOXES) == ABChooser.NO_OPTION) { + Preferences.clear(context.getString(R.string.p_simple_input_boxes)); + } } /** @@ -145,11 +149,16 @@ public class ABTests { public static final String AB_TITLE_ONLY = "android_title_only"; //$NON-NLS-1$ + public static final String AB_SIMPLE_EDIT_BOXES = "android_simple_edit_boxes"; //$NON-NLS-1$ + private void initialize() { addTest(AB_USE_DATE_SHORTCUTS, new int[] { 1, 1 }, new int[] { 1, 9 }, new String[] { "date-shortcuts-off", "date-shortcuts-on" }, false); //$NON-NLS-1$ //$NON-NLS-2$ addTest(AB_TITLE_ONLY, new int[] { 9, 1 }, - new int[] { 1, 0 }, new String[] { "default-row-style", "title-only-style" }, false); //$NON-NLS-1$//$NON-NLS-2$ + new int[] { 1, 0 }, new String[] { "default-row-style", "title-only-style" }, false); //$NON-NLS-1$//$NON-NLS-2$ + + addTest(AB_SIMPLE_EDIT_BOXES, new int[] { 1, 1 }, + new int[] { 9, 1 }, new String[] { "default-box-style", "simple-box-style" }, false); //$NON-NLS-1$//$NON-NLS-2$ } } diff --git a/astrid/src/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java b/astrid/src/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java index e27b391e4..64d418721 100644 --- a/astrid/src/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java +++ b/astrid/src/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java @@ -121,7 +121,8 @@ public class AstridDefaultPreferenceSpec extends AstridPreferenceSpec { setPreference(prefs, editor, r, R.string.p_use_filters, true, ifUnset); - setPreference(prefs, editor, r, R.string.p_simple_input_boxes, true, ifUnset); + setPreference(prefs, editor, r, R.string.p_simple_input_boxes, + ABChooser.readChoiceForTest(ABTests.AB_SIMPLE_EDIT_BOXES) != 0, ifUnset); setPreference(prefs, editor, r, R.string.p_show_list_members, true, ifUnset); setPreference(prefs, editor, r, R.string.p_rmd_social, true, ifUnset);