From 887bd1fe1af9a37aad78ad51f5b38b265aa09c3a Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 30 May 2017 21:22:06 -0700 Subject: Show more shortcuts when last notification is dimissed We currently only show 2 shortcuts when notifications are present, but support up to 4 otherwise. With this change, the hidden shortcuts are added back after dismissing the notifications, instead of only after closing and reopening the container. To ensure the transition is as elegant as possible, we also separated the shortcuts header from the rest of the shortcuts. That way we can reveal the new shortcuts without removing the header (the shortcuts come out from behind the header). Bug: 38036250 Change-Id: Ie9ab35f9be57cec1d5345e9e70e84e09ea52c9fc --- .../android/launcher3/popup/PopupPopulatorTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/src/com/android/launcher3/popup/PopupPopulatorTest.java b/tests/src/com/android/launcher3/popup/PopupPopulatorTest.java index 2ad9b35ae..9a89b1b2f 100644 --- a/tests/src/com/android/launcher3/popup/PopupPopulatorTest.java +++ b/tests/src/com/android/launcher3/popup/PopupPopulatorTest.java @@ -28,7 +28,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import static com.android.launcher3.popup.PopupPopulator.MAX_ITEMS; +import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS; import static com.android.launcher3.popup.PopupPopulator.NUM_DYNAMIC; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -44,18 +44,18 @@ public class PopupPopulatorTest { public void testSortAndFilterShortcuts() { filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(3, 0), 3, 0); filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(0, 3), 0, 3); - filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(5, 0), MAX_ITEMS, 0); - filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(0, 5), 0, MAX_ITEMS); + filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(5, 0), MAX_SHORTCUTS, 0); + filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(0, 5), 0, MAX_SHORTCUTS); filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(3, 3), - MAX_ITEMS - NUM_DYNAMIC, NUM_DYNAMIC); + MAX_SHORTCUTS - NUM_DYNAMIC, NUM_DYNAMIC); filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(5, 5), - MAX_ITEMS - NUM_DYNAMIC, NUM_DYNAMIC); - filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(5, 1), MAX_ITEMS - 1, 1); - filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(1, 5), 1, MAX_ITEMS - 1); + MAX_SHORTCUTS - NUM_DYNAMIC, NUM_DYNAMIC); + filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(5, 1), MAX_SHORTCUTS - 1, 1); + filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(1, 5), 1, MAX_SHORTCUTS - 1); filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(5, 3), - MAX_ITEMS - NUM_DYNAMIC, NUM_DYNAMIC); + MAX_SHORTCUTS - NUM_DYNAMIC, NUM_DYNAMIC); filterShortcutsAndAssertNumStaticAndDynamic(createShortcutsList(3, 5), - MAX_ITEMS - NUM_DYNAMIC, NUM_DYNAMIC); + MAX_SHORTCUTS - NUM_DYNAMIC, NUM_DYNAMIC); } @Test -- cgit v1.2.3