From d805837a877bb503d7890c4f92cfd183dec8c5ee Mon Sep 17 00:00:00 2001 From: Sandeep Siddhartha Date: Tue, 28 Jan 2014 10:41:15 -0800 Subject: [PATCH] Add callback for "Widgets" button click in launcher Bug: 12553852 Change-Id: I8befd046242b32e86dbc6c98e6d97f0307380dd0 --- src/com/android/launcher3/Launcher.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 709f4cf532..fca443c588 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);