diff --git a/res/values/strings.xml b/res/values/strings.xml index 6fb72b140b..351182d8a6 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -40,9 +40,9 @@ - Touch & hold to pick up a widget. + Touch & hold to move a widget. - Double-tap & hold to pick up a widget or use custom actions. + Double-tap & hold to move a widget or use custom actions. %1$d \u00d7 %2$d @@ -104,9 +104,9 @@ - Touch & hold to pick up a shortcut. + Touch & hold to move a shortcut. - Double-tap & hold to pick up a shortcut or use custom actions. + Double-tap & hold to move a shortcut or use custom actions. diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java index 03c58bb387..4fe631aa61 100644 --- a/src/com/android/launcher3/widget/BaseWidgetSheet.java +++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java @@ -74,7 +74,18 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView @Override public final void onClick(View v) { - mWidgetInstructionToast = showWidgetToast(getContext(), mWidgetInstructionToast); + Object tag = null; + if (v instanceof WidgetCell) { + tag = v.getTag(); + } else if (v.getParent() instanceof WidgetCell) { + tag = ((WidgetCell) v.getParent()).getTag(); + } + if (tag instanceof PendingAddShortcutInfo) { + mWidgetInstructionToast = showShortcutToast(getContext(), mWidgetInstructionToast); + } else { + mWidgetInstructionToast = showWidgetToast(getContext(), mWidgetInstructionToast); + } + } @Override @@ -158,4 +169,21 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView toast.show(); return toast; } + + /** + * Show shortcut tap toast prompting user to drag instead. + */ + private static Toast showShortcutToast(Context context, Toast toast) { + // Let the user know that they have to long press to add a widget + if (toast != null) { + toast.cancel(); + } + + CharSequence msg = Utilities.wrapForTts( + context.getText(R.string.long_press_shortcut_to_add), + context.getString(R.string.long_accessible_way_to_add_shortcut)); + toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT); + toast.show(); + return toast; + } }