From 3a2a69ab3dcba2372bfbbc31b8db64f56ccbb47b Mon Sep 17 00:00:00 2001 From: Charlie Anderson Date: Mon, 13 Mar 2023 17:20:32 -0400 Subject: [PATCH] Fixes tests and issues when toggling new app shortcut popup flag. Bug: 247880037 Test: manually tested app popup. Also ran Launcher tests locally with U flag on/off. Change-Id: I93c04f9715d583376c36d823c23353619afd26b6 --- .../system_shortcut_icons_container.xml | 2 +- ...em_shortcut_icons_container_material_u.xml | 2 +- res/layout/system_shortcut_rows_container.xml | 1 - ...tem_shortcut_rows_container_material_u.xml | 25 +++++++++++++++++++ .../popup/PopupContainerWithArrow.java | 9 ++++--- 5 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 res/layout/system_shortcut_rows_container_material_u.xml diff --git a/res/layout/system_shortcut_icons_container.xml b/res/layout/system_shortcut_icons_container.xml index dc4fdb3832..fa92ba3d01 100644 --- a/res/layout/system_shortcut_icons_container.xml +++ b/res/layout/system_shortcut_icons_container.xml @@ -16,7 +16,7 @@ + + + diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index 43ca2a6efb..9f290f7b51 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -327,11 +327,14 @@ public class PopupContainerWithArrow initializeSystemShortcuts(systemShortcuts); } else { mDeepShortcutContainer.setVisibility(View.GONE); + mSystemShortcutContainer = inflateAndAdd(R.layout.system_shortcut_rows_container, + this, 0); + mWidgetContainer = mSystemShortcutContainer; if (!shortcuts.isEmpty()) { for (int i = 0; i < shortcuts.size(); i++) { initializeSystemShortcut( R.layout.system_shortcut, - this, + mSystemShortcutContainer, shortcuts.get(i), i < shortcuts.size() - 1); } @@ -358,7 +361,7 @@ public class PopupContainerWithArrow addAllShortcutsMaterialU(deepShortcutCount, systemShortcuts); } else if (!systemShortcuts.isEmpty()) { addSystemShortcutsMaterialU(systemShortcuts, - R.layout.system_shortcut_rows_container, + R.layout.system_shortcut_rows_container_material_u, R.layout.system_shortcut); } show(); @@ -395,7 +398,7 @@ public class PopupContainerWithArrow if (deepShortcutCount + systemShortcuts.size() <= SHORTCUT_COLLAPSE_THRESHOLD) { // add all system shortcuts including widgets shortcut to same container addSystemShortcutsMaterialU(systemShortcuts, - R.layout.system_shortcut_rows_container, + R.layout.system_shortcut_rows_container_material_u, R.layout.system_shortcut); addDeepShortcutsMaterialU(deepShortcutCount); return;