Add Hotseat items to Taskbar
- Currently supports WorkspaceItemInfo (e.g. normal app icons
including hotseat predictions and pinned deep shortcuts).
- Currently doesn't support Folders, Notification dots, or
long press.
Some technical details:
- Always allow HotseatPredictionController updates given the
Hotseat is always showing even when Launcher is stopped.
- Represent Taskbar Hotseat items as BubbleTextViews, to
allow for normal click handling etc. When the hotseat is
updated, we reuse the same BubbleTextViews that were
initially inflated, and just reapply the new info.
- Add new BubbleTextView iconDisplay for Taskbar, to allow
for different treatment such as icon size.
Bug: 171917176
Change-Id: I325eb39051f2dc69228b39b5c40ed0cbdad8e200
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 0274775..2334267 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1917,6 +1917,13 @@
@Override
public boolean startActivitySafely(View v, Intent intent, ItemInfo item) {
+ if (isViewInTaskbar(v)) {
+ // Start the activity without the hacky workarounds below, which assume the View was
+ // clicked when Launcher was resumed and will be hidden until Launcher is re-resumed
+ // (this isn't the case for Taskbar).
+ return super.startActivitySafely(v, intent, item);
+ }
+
if (!hasBeenResumed()) {
// Workaround an issue where the WM launch animation is clobbered when finishing the
// recents animation into launcher. Defer launching the activity until Launcher is
@@ -2818,6 +2825,13 @@
.start();
}
+ /**
+ * @return Whether the View is in the same window as the Taskbar window.
+ */
+ public boolean isViewInTaskbar(View v) {
+ return false;
+ }
+
private static class NonConfigInstance {
public Configuration config;
public Bitmap snapshot;