summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <raj@cyngn.com>2015-01-14 08:24:59 (GMT)
committerMatt Garnes <matt@cyngn.com>2015-01-21 03:52:35 (GMT)
commitd44aa3775ad4ebca28070e9eb4d013c380dce6c4 (patch)
treeabf237f491eebb3dce19e0dfd8cb0f27e8f72159
parentc183e8c5d9c5ed1137b6a4cabe456b4db219da31 (diff)
downloadandroid_packages_apps_Trebuchet-d44aa3775ad4ebca28070e9eb4d013c380dce6c4.zip
android_packages_apps_Trebuchet-d44aa3775ad4ebca28070e9eb4d013c380dce6c4.tar.gz
android_packages_apps_Trebuchet-d44aa3775ad4ebca28070e9eb4d013c380dce6c4.tar.bz2
Adding manage apps shortcut to Settings panel
Change-Id: I02b454072258d57e82c825417941382ea7807e83 (cherry picked from commit cc342519488d50d2f59f514940de6cf02bd53ab2)
-rw-r--r--res/drawable-hdpi/ic_apps.pngbin0 -> 587 bytes
-rw-r--r--res/drawable-hdpi/ic_apps_pressed.pngbin0 -> 589 bytes
-rw-r--r--res/drawable-mdpi/ic_apps.pngbin0 -> 380 bytes
-rw-r--r--res/drawable-mdpi/ic_apps_pressed.pngbin0 -> 406 bytes
-rw-r--r--res/drawable-xhdpi/ic_apps.pngbin0 -> 664 bytes
-rw-r--r--res/drawable-xhdpi/ic_apps_pressed.pngbin0 -> 652 bytes
-rw-r--r--res/drawable-xxhdpi/ic_apps.pngbin0 -> 1180 bytes
-rw-r--r--res/drawable-xxhdpi/ic_apps_pressed.pngbin0 -> 1152 bytes
-rw-r--r--res/drawable/manage_apps_button.xml21
-rwxr-xr-xres/layout/settings_pane.xml15
-rw-r--r--res/values/strings.xml6
-rw-r--r--src/com/android/launcher3/Launcher.java11
-rw-r--r--src/com/android/launcher3/OverviewSettingsPanel.java14
13 files changed, 64 insertions, 3 deletions
diff --git a/res/drawable-hdpi/ic_apps.png b/res/drawable-hdpi/ic_apps.png
new file mode 100644
index 0000000..1f5bc89
--- /dev/null
+++ b/res/drawable-hdpi/ic_apps.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_apps_pressed.png b/res/drawable-hdpi/ic_apps_pressed.png
new file mode 100644
index 0000000..e1edaab
--- /dev/null
+++ b/res/drawable-hdpi/ic_apps_pressed.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_apps.png b/res/drawable-mdpi/ic_apps.png
new file mode 100644
index 0000000..5df8984
--- /dev/null
+++ b/res/drawable-mdpi/ic_apps.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_apps_pressed.png b/res/drawable-mdpi/ic_apps_pressed.png
new file mode 100644
index 0000000..30b569b
--- /dev/null
+++ b/res/drawable-mdpi/ic_apps_pressed.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_apps.png b/res/drawable-xhdpi/ic_apps.png
new file mode 100644
index 0000000..3501486
--- /dev/null
+++ b/res/drawable-xhdpi/ic_apps.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_apps_pressed.png b/res/drawable-xhdpi/ic_apps_pressed.png
new file mode 100644
index 0000000..ef48829
--- /dev/null
+++ b/res/drawable-xhdpi/ic_apps_pressed.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_apps.png b/res/drawable-xxhdpi/ic_apps.png
new file mode 100644
index 0000000..9860a44
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_apps.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_apps_pressed.png b/res/drawable-xxhdpi/ic_apps_pressed.png
new file mode 100644
index 0000000..a2354aa
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_apps_pressed.png
Binary files differ
diff --git a/res/drawable/manage_apps_button.xml b/res/drawable/manage_apps_button.xml
new file mode 100644
index 0000000..24d841e
--- /dev/null
+++ b/res/drawable/manage_apps_button.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_focused="true" android:drawable="@drawable/ic_apps_pressed" />
+ <item android:state_pressed="true" android:drawable="@drawable/ic_apps_pressed" />
+ <item android:drawable="@drawable/ic_apps" />
+</selector>
diff --git a/res/layout/settings_pane.xml b/res/layout/settings_pane.xml
index ed1cc8f..77c8d4d 100755
--- a/res/layout/settings_pane.xml
+++ b/res/layout/settings_pane.xml
@@ -94,6 +94,21 @@
android:textColor="@android:color/white"
android:maxLines="2" />
+ <TextView
+ android:id="@+id/manage_apps_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:drawablePadding="4dp"
+ android:drawableTop="@drawable/manage_apps_button"
+ android:fontFamily="sans-serif-condensed"
+ android:gravity="center_horizontal"
+ android:layout_weight="2"
+ android:text="@string/manage_apps_button_text"
+ android:textAllCaps="true"
+ android:textSize="12sp"
+ android:textColor="@android:color/white"
+ android:maxLines="2" />
+
<Space
android:layout_width="0dip"
android:layout_height="1dp"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ff3509b..c3ba512 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -52,7 +52,7 @@
<!-- AppsCustomize pane -->
<!-- Message to tell the user to press and hold on a widget to add it [CHAR_LIMIT=50] -->
<string name="long_press_widget_to_add">Touch &amp; hold to pick up a widget.</string>
- <!-- Market button text. The market button text is removed in Launcher.java
+ <!-- Market button text. The market button text is removed in Launcher.java
in the Phone UI. [CHAR LIMIT=32] -->
<string name="market">Shop</string>
<!-- The format string for the dimensions of a widget in the drawer -->
@@ -188,7 +188,7 @@ s -->
shortcuts in Home.</string>
<!-- Widgets: -->
- <skip />
+ <skip />
<!-- Text to show user in place of a gadget when we can't display it properly -->
<string name="gadget_error_text">Problem loading widget</string>
@@ -283,6 +283,8 @@ s -->
<string name="wallpaper_button_text">Wallpapers</string>
<!-- Text for settings button -->
<string name="settings_button_text">Settings</string>
+ <!-- Text for manage apps button -->
+ <string name="manage_apps_button_text">Apps</string>
<!-- Label on an icon that references an uninstalled package, that is going to be installed at some point. [CHAR_LIMIT=15] -->
<string name="package_state_enqueued">Waiting</string>
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 2e564c4..937a167 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -225,6 +225,8 @@ public class Launcher extends Activity
static final String FIRST_LOAD_COMPLETE = "launcher.first_load_complete";
static final String ACTION_FIRST_LOAD_COMPLETE =
"com.android.launcher3.action.FIRST_LOAD_COMPLETE";
+ static final String ACTION_MANAGE_APPS=
+ "android.settings.MANAGE_APPLICATIONS_SETTINGS";
private static final String TOOLBAR_ICON_METADATA_NAME = "com.android.launcher.toolbar_icon";
private static final String TOOLBAR_SEARCH_ICON_METADATA_NAME =
@@ -1426,6 +1428,15 @@ public class Launcher extends Activity
}
}
+ protected void startManageApps() {
+ Intent manageApps;
+ manageApps= new Intent(ACTION_MANAGE_APPS);
+ startActivity(manageApps);
+ if (mWorkspace.isInOverviewMode()) {
+ mWorkspace.exitOverviewMode(false);
+ }
+ }
+
public interface QSBScroller {
public void setScrollY(int scrollY);
}
diff --git a/src/com/android/launcher3/OverviewSettingsPanel.java b/src/com/android/launcher3/OverviewSettingsPanel.java
index 2403d23..e07c16e 100644
--- a/src/com/android/launcher3/OverviewSettingsPanel.java
+++ b/src/com/android/launcher3/OverviewSettingsPanel.java
@@ -90,7 +90,6 @@ public class OverviewSettingsPanel {
((SlidingUpPanelLayout) mOverviewPanel)
.setPanelSlideListener(new SettingsSimplePanelSlideListener());
- //Quick Settings Buttons
View widgetButton = mLauncher.findViewById(R.id.widget_button);
widgetButton.setOnClickListener(new OnClickListener() {
@Override
@@ -109,6 +108,7 @@ public class OverviewSettingsPanel {
});
wallpaperButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener());
+ //Quick Settings Button
View settingsButton = mLauncher.findViewById(R.id.settings_button);
settingsButton.setOnClickListener(new OnClickListener() {
@Override
@@ -120,6 +120,18 @@ public class OverviewSettingsPanel {
});
settingsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener());
+ //Manage Apps Button
+ View manageAppsButton = mLauncher.findViewById(R.id.manage_apps_button);
+ manageAppsButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) {
+ if (!mLauncher.getWorkspace().isSwitchingState()) {
+ mLauncher.startManageApps();
+ }
+ }
+ });
+ manageAppsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener());
+
View defaultScreenButton = mLauncher.findViewById(R.id.default_screen_button);
defaultScreenButton.setOnClickListener(new OnClickListener() {
@Override