Show or hide specific menu items from the appearance prefs

pull/14/head
Sam Bosley 13 years ago
parent 0ce7921dc3
commit 8d6f94abbf

@ -65,7 +65,6 @@
<string name="p_force_phone_layout">force_phone_layout</string>
<!-- show featured lists -->
<string name="p_show_featured_lists">show_featured_lists_labs</string>
<!-- account status section key -->
<string name="p_account">account</string>
@ -84,6 +83,15 @@
<!-- show quickadd controls -->
<string name="p_show_quickadd_controls">p_show_quickadd_controls</string>
<!-- menu items to show -->
<string name="p_menu_items">p_menu_items</string>
<string name="p_show_menu_search">p_show_menu_search</string>
<string name="p_show_menu_friends">p_show_menu_friends</string>
<string name="p_show_featured_lists">p_show_featured_lists_labs</string>
<string name="p_show_menu_sync">p_show_menu_sync</string>
<string name="p_show_menu_sort">p_show_menu_sort</string>
<string name="p_show_menu_addons">p_show_menu_addons</string>
<string-array name="TEA_reminder_random_hours">
<!-- values (in hours) associated with items above. -->
<item>1</item>

@ -711,6 +711,9 @@
<!-- Preference: simple input box style -->
<string name="EPr_show_quickadd_controls">Advanced quickadd controls</string>
<!-- Preference: menu items -->
<string name="EPr_menu_items">Menu items</string>
<!-- slide 30f/ 36f: Preference: Theme -->
<string name="EPr_theme_title">Color theme</string>

@ -56,6 +56,33 @@
<PreferenceScreen android:title="@string/EPr_beastMode_title"
android:key="@string/p_beastMode"/>
<PreferenceScreen android:title="@string/EPr_menu_items" android:key="@string/p_menu_items">
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_show_menu_search"
android:title="@string/TLA_menu_search"
android:defaultValue="true" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_show_menu_friends"
android:title="@string/TLA_menu_friends"
android:defaultValue="true"/>
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_show_featured_lists"
android:title="@string/EPr_show_featured_lists"
android:defaultValue="true"/>
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_show_menu_sync"
android:title="@string/TLA_menu_sync"
android:defaultValue="true"/>
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_show_menu_sort"
android:title="@string/TLA_menu_sort"
android:defaultValue="true"/>
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_show_menu_addons"
android:title="@string/TLA_menu_addons"
android:defaultValue="true"/>
</PreferenceScreen>
<PreferenceScreen android:title="@string/EPr_filters_to_show_title" android:key="@string/p_filters_to_show">
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_show_my_tasks_filter"
@ -78,7 +105,6 @@
android:key="@string/p_show_not_in_list_filter"
android:title="@string/tag_FEx_untagged"
android:defaultValue="true"/>
</PreferenceScreen>
<com.todoroo.astrid.ui.MultilineListPreference
@ -134,11 +160,6 @@
android:title="@string/EPr_show_list_members_title"
android:defaultValue="true"/>
<CheckBoxPreference
android:title="@string/EPr_show_featured_lists"
android:key="@string/p_show_featured_lists"
android:defaultValue="false"/>
<CheckBoxPreference
android:key="@string/p_use_contact_picker"
android:title="@string/EPr_use_contact_picker"/>

@ -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) {

@ -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);

@ -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),

@ -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();

@ -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

Loading…
Cancel
Save