diff --git a/astrid/res/values/keys.xml b/astrid/res/values/keys.xml index 755e9c1b1..ffe9af506 100644 --- a/astrid/res/values/keys.xml +++ b/astrid/res/values/keys.xml @@ -65,7 +65,6 @@ force_phone_layout - show_featured_lists_labs account @@ -84,6 +83,15 @@ p_show_quickadd_controls + + p_menu_items + p_show_menu_search + p_show_menu_friends + p_show_featured_lists_labs + p_show_menu_sync + p_show_menu_sort + p_show_menu_addons + 1 diff --git a/astrid/res/values/strings-core.xml b/astrid/res/values/strings-core.xml index a0f25af6d..eb0457661 100644 --- a/astrid/res/values/strings-core.xml +++ b/astrid/res/values/strings-core.xml @@ -711,6 +711,9 @@ Advanced quickadd controls + + + Menu items Color theme diff --git a/astrid/res/xml/preferences.xml b/astrid/res/xml/preferences.xml index e1cbe3056..2f2f12281 100644 --- a/astrid/res/xml/preferences.xml +++ b/astrid/res/xml/preferences.xml @@ -56,6 +56,33 @@ + + + + + + + + + - - - diff --git a/astrid/src/com/todoroo/astrid/activity/EditPreferences.java b/astrid/src/com/todoroo/astrid/activity/EditPreferences.java index 80e1ec4cd..5c16c9f03 100644 --- a/astrid/src/com/todoroo/astrid/activity/EditPreferences.java +++ b/astrid/src/com/todoroo/astrid/activity/EditPreferences.java @@ -644,6 +644,13 @@ public class EditPreferences extends TodorooPreferenceActivity { findPreference(getString(R.string.p_fontSize)).setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED)); + int[] menuPrefs = { R.string.p_show_menu_search, R.string.p_show_menu_friends, R.string.p_show_featured_lists, + R.string.p_show_menu_sync, R.string.p_show_menu_sort, R.string.p_show_menu_addons + }; + for (int key : menuPrefs) { + findPreference(getString(key)).setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED)); + } + findPreference(getString(R.string.p_theme_widget)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java index 1f40e68ae..af953d501 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java @@ -446,11 +446,11 @@ public class TaskListFragment extends ListFragment implements OnScrollListener, tla.getMainMenuPopover().clear(); } // --- sync - if (tla == null || tla.getTaskEditFragment() == null) + if (tla == null || tla.getTaskEditFragment() == null && Preferences.getBoolean(R.string.p_show_menu_sync, true)) addSyncRefreshMenuItem(menu, isTablet ? ThemeService.FLAG_INVERT : 0); // --- sort - if (allowResorting()) { + if (allowResorting() && Preferences.getBoolean(R.string.p_show_menu_sort, true)) { addMenuItem(menu, R.string.TLA_menu_sort, ThemeService.getDrawable(R.drawable.icn_menu_sort_by_size, isTablet ? ThemeService.FLAG_FORCE_DARK: 0), MENU_SORT_ID, false); } @@ -461,7 +461,7 @@ public class TaskListFragment extends ListFragment implements OnScrollListener, ThemeService.getDrawable(R.drawable.icn_menu_filters, isTablet ? ThemeService.FLAG_FORCE_DARK: 0), MENU_NEW_FILTER_ID, false); // --- addons - if(Constants.MARKET_STRATEGY.showAddonMenu()) + if(Constants.MARKET_STRATEGY.showAddonMenu() && Preferences.getBoolean(R.string.p_show_menu_addons, true)) addMenuItem(menu, R.string.TLA_menu_addons, ThemeService.getDrawable(R.drawable.icn_menu_plugins, isTablet ? ThemeService.FLAG_FORCE_DARK : 0), MENU_ADDONS_ID, false); diff --git a/astrid/src/com/todoroo/astrid/ui/MainMenuPopover.java b/astrid/src/com/todoroo/astrid/ui/MainMenuPopover.java index 2ac545d7a..a0c940e7f 100644 --- a/astrid/src/com/todoroo/astrid/ui/MainMenuPopover.java +++ b/astrid/src/com/todoroo/astrid/ui/MainMenuPopover.java @@ -108,9 +108,10 @@ public class MainMenuPopover extends FragmentPopover implements InterceptTouchLi private void addFixedItems() { int themeFlags = isTablet ? ThemeService.FLAG_FORCE_DARK : 0; - addMenuItem(R.string.TLA_menu_search, - ThemeService.getDrawable(R.drawable.icn_menu_search, themeFlags), - MAIN_MENU_ITEM_SEARCH, null, topFixed); + if (Preferences.getBoolean(R.string.p_show_menu_search, true)) + addMenuItem(R.string.TLA_menu_search, + ThemeService.getDrawable(R.drawable.icn_menu_search, themeFlags), + MAIN_MENU_ITEM_SEARCH, null, topFixed); addMenuItem(R.string.TLA_menu_lists, ThemeService.getDrawable(R.drawable.icn_menu_lists, themeFlags), diff --git a/astrid/src/com/todoroo/astrid/utility/AstridLitePreferenceSpec.java b/astrid/src/com/todoroo/astrid/utility/AstridLitePreferenceSpec.java index 101cd5c30..dafe0c1d5 100644 --- a/astrid/src/com/todoroo/astrid/utility/AstridLitePreferenceSpec.java +++ b/astrid/src/com/todoroo/astrid/utility/AstridLitePreferenceSpec.java @@ -92,7 +92,6 @@ public class AstridLitePreferenceSpec extends AstridPreferenceSpec { setPreference(prefs, editor, r, R.string.p_ideas_tab_enabled, false, ifUnset); setPreference(prefs, editor, r, R.string.p_autoIdea, false, ifUnset); - setPreference(prefs, editor, r, R.string.p_show_featured_lists, false, ifUnset); setPreference(prefs, editor, r, R.string.p_taskRowStyle, true, ifUnset); @@ -113,6 +112,13 @@ public class AstridLitePreferenceSpec extends AstridPreferenceSpec { setPreference(prefs, editor, r, R.string.p_show_ive_assigned_filter, false, ifUnset); setPreference(prefs, editor, r, R.string.p_show_not_in_list_filter, false, ifUnset); + setPreference(prefs, editor, r, R.string.p_show_menu_search, false, ifUnset); + setPreference(prefs, editor, r, R.string.p_show_menu_friends, false, ifUnset); + setPreference(prefs, editor, r, R.string.p_show_featured_lists, false, ifUnset); + setPreference(prefs, editor, r, R.string.p_show_menu_sync, false, ifUnset); + setPreference(prefs, editor, r, R.string.p_show_menu_sort, false, ifUnset); + setPreference(prefs, editor, r, R.string.p_show_menu_addons, false, ifUnset); + extras.setExtras(context, prefs, editor, r, ifUnset); editor.commit(); diff --git a/astrid/src/com/todoroo/astrid/utility/Constants.java b/astrid/src/com/todoroo/astrid/utility/Constants.java index aebfd040c..de4414a77 100644 --- a/astrid/src/com/todoroo/astrid/utility/Constants.java +++ b/astrid/src/com/todoroo/astrid/utility/Constants.java @@ -46,7 +46,7 @@ public final class Constants { /** * Whether this version is Astrid Lite */ - public static final boolean ASTRID_LITE = false; + public static final boolean ASTRID_LITE = true; /** * Astrid Help URL