diff --git a/res/values/strings.xml b/res/values/strings.xml index 300364a..d7dd961 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -309,6 +309,8 @@ s --> Choose the default homescreen Search bar Enable persistent search bar + All apps button + Show the all apps button in the top right corner of the homescreen Grid size Choose the number of rows/columns on the homescreen Rows diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 3023f60..e18aa6c 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -62,6 +62,10 @@ android:title="@string/preferences_interface_homescreen_general_search_title" android:summary="@string/preferences_interface_homescreen_general_search_summary" android:defaultValue="true" /> + diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java index da1778a..558e01e 100644 --- a/src/com/cyanogenmod/trebuchet/Launcher.java +++ b/src/com/cyanogenmod/trebuchet/Launcher.java @@ -303,6 +303,7 @@ public final class Launcher extends Activity // Preferences private boolean mShowSearchBar; + private boolean mShowAllAppsButton; private boolean mShowDockDivider; private boolean mHideIconLabels; private boolean mAutoRotate; @@ -359,6 +360,7 @@ public final class Launcher extends Activity // Preferences mShowSearchBar = PreferencesProvider.Interface.Homescreen.getShowSearchBar(this); + mShowAllAppsButton = PreferencesProvider.Interface.Homescreen.getShowAllAppsButton(this); mShowDockDivider = PreferencesProvider.Interface.Homescreen.Indicator.getShowDockDivider(this); mHideIconLabels = PreferencesProvider.Interface.Homescreen.getHideIconLabels(this); mAutoRotate = PreferencesProvider.Interface.General.getAutoRotate(this, getResources().getBoolean(R.bool.allow_rotation)); @@ -981,6 +983,10 @@ public final class Launcher extends Activity } }); } + if (!mShowAllAppsButton) { + mAllAppsButton.setVisibility(View.GONE); + } + // Setup the drag controller (drop targets have to be added in reverse order in priority) dragController.setDragScoller(mWorkspace); dragController.setScrollView(mDragLayer); @@ -2332,7 +2338,11 @@ public final class Launcher extends Activity // User long pressed on empty space mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS, HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING); - startWallpaper(); + if (mShowAllAppsButton) { + startWallpaper(); + } else { + showAllApps(true); + } } else { if (!(itemUnderLongClick instanceof Folder)) { // User long pressed on an item @@ -2806,7 +2816,7 @@ public final class Launcher extends Activity showDockDivider(animated && wasInSpringLoadedMode); // Set focus to the AppsCustomize button - if (mAllAppsButton != null) { + if (mAllAppsButton != null && mShowAllAppsButton) { mAllAppsButton.requestFocus(); } } diff --git a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java index b4228c3..c2aa705 100644 --- a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java +++ b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java @@ -70,6 +70,10 @@ public final class PreferencesProvider { final SharedPreferences preferences = context.getSharedPreferences(PREFERENCES_KEY, 0); return preferences.getBoolean("ui_homescreen_general_search", true); } + public static boolean getShowAllAppsButton(Context context) { + final SharedPreferences preferences = context.getSharedPreferences(PREFERENCES_KEY, 0); + return preferences.getBoolean("ui_homescreen_all_apps_button", true); + } public static boolean getResizeAnyWidget(Context context) { final SharedPreferences preferences = context.getSharedPreferences(PREFERENCES_KEY, 0); return preferences.getBoolean("ui_homescreen_general_resize_any_widget", false);