summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep Siddhartha <sansid@google.com>2014-01-28 10:41:15 -0800
committerSandeep Siddhartha <sansid@google.com>2014-01-28 10:41:15 -0800
commitd805837a877bb503d7890c4f92cfd183dec8c5ee (patch)
tree76c9c0fda31570bd4c840a3aa5943cc484259eb0
parentf4d081107f5984bfb92cb1a627667fea5bf1498c (diff)
downloadandroid_packages_apps_Trebuchet-d805837a877bb503d7890c4f92cfd183dec8c5ee.tar.gz
android_packages_apps_Trebuchet-d805837a877bb503d7890c4f92cfd183dec8c5ee.tar.bz2
android_packages_apps_Trebuchet-d805837a877bb503d7890c4f92cfd183dec8c5ee.zip
Add callback for "Widgets" button click in launcher
Bug: 12553852 Change-Id: I8befd046242b32e86dbc6c98e6d97f0307380dd0
-rw-r--r--src/com/android/launcher3/Launcher.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 709f4cf53..fca443c58 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2373,7 +2373,7 @@ public class Launcher extends Activity
final String shortcutClass = intent.getComponent().getClassName();
if (shortcutClass.equals(WidgetAdder.class.getName())) {
- showAllApps(true, AppsCustomizePagedView.ContentType.Widgets, true);
+ onClickAddWidgetButton();
return;
} else if (shortcutClass.equals(MemoryDumpActivity.class.getName())) {
MemoryDumpActivity.startDump(this);
@@ -2466,6 +2466,14 @@ public class Launcher extends Activity
showAllApps(true, AppsCustomizePagedView.ContentType.Applications, false);
}
+ /**
+ * Event handler for the (Add) Widgets button that appears after a long press
+ * on the home screen.
+ */
+ protected void onClickAddWidgetButton() {
+ showAllApps(true, AppsCustomizePagedView.ContentType.Widgets, true);
+ }
+
public void onTouchDownAllAppsButton(View v) {
// Provide the same haptic feedback that the system offers for virtual keys.
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);