Merging widget item click listener to default click listener

> Also removing check for dragHandle, since dragHandle is already removed

Bug: 307306823
Test: atest Launcher3Tests
Flag: N/A
Change-Id: I0b452dd1fbccf15ed686370471e8866b179fd77e
This commit is contained in:
Sunny Goyal
2023-11-27 15:35:44 -08:00
parent eb29313595
commit 464509b375
6 changed files with 28 additions and 127 deletions

View File

@@ -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);
}
}