summaryrefslogtreecommitdiff
path: root/src/com/android/launcher3/touch/ItemClickHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/touch/ItemClickHandler.java')
-rw-r--r--src/com/android/launcher3/touch/ItemClickHandler.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/com/android/launcher3/touch/ItemClickHandler.java b/src/com/android/launcher3/touch/ItemClickHandler.java
index 8c12547bb5..a9c2a2e368 100644
--- a/src/com/android/launcher3/touch/ItemClickHandler.java
+++ b/src/com/android/launcher3/touch/ItemClickHandler.java
@@ -15,8 +15,8 @@
*/
package com.android.launcher3.touch;
-import static com.android.launcher3.Launcher.REQUEST_BIND_PENDING_APPWIDGET;
-import static com.android.launcher3.Launcher.REQUEST_RECONFIGURE_APPWIDGET;
+import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_BIND_PENDING_APPWIDGET;
+import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_RECONFIGURE_APPWIDGET;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_DISABLED_BY_PUBLISHER;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_DISABLED_LOCKED_USER;
@@ -61,7 +61,10 @@ import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.views.FloatingIconView;
+import com.android.launcher3.views.Snackbar;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
+import com.android.launcher3.widget.PendingAddShortcutInfo;
+import com.android.launcher3.widget.PendingAddWidgetInfo;
import com.android.launcher3.widget.PendingAppWidgetHostView;
import com.android.launcher3.widget.WidgetAddFlowHandler;
import com.android.launcher3.widget.WidgetManagerHelper;
@@ -107,6 +110,16 @@ public class ItemClickHandler {
}
} else if (tag instanceof ItemClickProxy) {
((ItemClickProxy) tag).onItemClicked(v);
+ } else if (tag instanceof PendingAddShortcutInfo) {
+ CharSequence msg = Utilities.wrapForTts(
+ launcher.getText(R.string.long_press_shortcut_to_add),
+ launcher.getString(R.string.long_accessible_way_to_add_shortcut));
+ Snackbar.show(launcher, msg, null);
+ } else if (tag instanceof PendingAddWidgetInfo) {
+ CharSequence msg = Utilities.wrapForTts(
+ launcher.getText(R.string.long_press_widget_to_add),
+ launcher.getString(R.string.long_accessible_way_to_add));
+ Snackbar.show(launcher, msg, null);
}
}
@@ -132,8 +145,8 @@ public class ItemClickHandler {
*/
private static void onClickAppPairIcon(View v) {
Launcher launcher = Launcher.getLauncher(v.getContext());
- FolderInfo folderInfo = ((AppPairIcon) v).getInfo();
- launcher.launchAppPair(folderInfo.contents.get(0), folderInfo.contents.get(1));
+ AppPairIcon appPairIcon = (AppPairIcon) v;
+ launcher.launchAppPair(appPairIcon);
}
/**