This makes the TaskMenuViewWithArrow open to the right of the icon if
there is enough space, and to the left if not. It also works correctly
in RTL, inverting the side to open by default.
Bug: 193432925
Test: open Overview and tap the app icon
Change-Id: Ib1098f48ed28d2e0758fb0e3fb733e86271fa1a0
Foldables use a different menu from phones, positioned either to the
right or left of the app icon, and display an arrow. Since TaskMenuView
is very specific for handhelds, it was cleaner to create another class
to handle foldables case extending from ArrowPopup.
This creates a working menu, the correct style will come in later CLs.
Bug: 193432925
Test: open Overview and tap the app icon
Fixes: 205298731
Test: atest NexusLauncherTests
Change-Id: I7a5c1fb4800a309f40fadb2df0f6c3a4c3f42679
This reverts commit 10eb3cd98b.
Reason for revert: Root cause of P0 b/205278434
Bug: 205278434
Bug: 193432925
Test: Local reverted and now launcher works on wembley
Change-Id: I3605c01066a3ce383d45e0a938f1e00b3c7f7bb9
Merged-In: I5ee18d3ee1b671fcaedda633e7a268addd5c5c15
Foldables use a different menu from phones, positioned either to the
right or left of the app icon, and display an arrow. Since TaskMenuView
is very specific for handhelds, it was cleaner to create another class
to handle foldables case extending from ArrowPopup.
This creates a working menu, the correct style will come in later CLs.
Bug: 193432925
Test: open Overview and tap the app icon
Change-Id: Icb068954e1e20a52d80c16c52d8e38ce9a181a8b
Merged-In: Icb068954e1e20a52d80c16c52d8e38ce9a181a8b
We were setting it again for the first child in any recursive call,
which could cause the color to be incorrect.
Test: Arrow always matches menu item below icon.
Fix: 201537864
Change-Id: I8f344bb7bdec4ebc51f8b8de118bec678d71e649
assignMarginsAndBackgrounds updates determines the new arrow color, but
it doesn't actually update it. That is normally done in
updateArrowColor.
Test: Icon menu arrow color changes to content above it after notification
dots dismissed.
Fix: 201458705
Change-Id: I5ee40b420b03c29c197983af5968d4f2902bc59b
> Calulating correct location irrespective of transient
state (scale/translation)
> Removing extraction pause/resume logic
> Simplifying location calculation and registration (only use one location instead of a list)
Bug: 194732483
Test: Manual
Change-Id: I255d83761bff5e09c9fb0a5e398d0be0c1d0956f
Bug: 191823198
Test: long press app where arrow is on top and bottom in:
workspace, all apps, and search UI
Change-Id: Icc4ac259607175d5e12447a844ba166ba28b74af
Also renamed to popup color to popup shade to better differentiate
between the primary/secondary/tertirary popup colors.
Bug: 191496301
Test: Removed v31 colors to verify the non-v31 colors, that the shades are as expected
Tested on wallpapaper with light text, again with dark mode
Tested on wallpaper with dark text, and then again with dark mode
Change-Id: I3ec9ee7f85696ee48224740a1ec7f4abe42348ee
- Also updating folder backgrounds, lStar only works in ColorStateList.
Bug: 191496301
Test: test wallpaper with light text, in light mode
test again in dark mode
test wallpaper with dark text, in light mode
test again in dark mode
Change-Id: I2d43d874e7e2fad6a9a0e039058beb58b204fa96
For Color exctraction now occurs in groups:
- System shortcuts
- Deep shortcuts
- Notifications
For home setting popup, each DeepShortcutView will have its own
extracted color.
Bug: 188095443
Test: manual
Change-Id: I7e209f863ff180b8f017aeb2a73c6f1a51842e68
Bug: 175329686
Test: long press on apps where container opens above & below
and where container is aligned left & right
Change-Id: I09bbf57b6e19cc6f022b9a96fb48d8c4ae080813
- Starts listening to local wallpaper colors as soon as folder
is positioned.
- The folder open animation already has a background color
animator.
- For simplicity, folder open animation always starts
first, and then we cancel its background color animator,
and start a new animator to the extracted color.
- setAutoCancel would be handy here, but it does not work, will
track in a separate bug.
- Since folders are reused, we clear our the color extractor on
folder close.
Bug: 175329686
Test: multiple folders on rainbow background
open each folder, ensure bg animates to proper color
Change-Id: Ie0f2c0632fa2361f7710ba247d74f882620dec16
have its own set of temp variables.
- Pass in float[] param to not create new obj in each frame
for dragging widget case.
Bug: 175329686
Bug: 187019711
Test: manual, verify
Change-Id: I4350fb7e66a80c73def5659fb41abc14d357e667
This reverts commit 17fda29bf3.
Reason for revert: Fixing the memory leak
Leak was detected in caused launcher tapl tests to fail.
For instructions on how to debug leaks, see go/launcher-testing.
Using AS memory profiler, the color extractor class is holding
onto a reference to launcher that has already been destroyed.
The fix is to set the listener to null when view is closed.
Bug: 175329686
Test: run profiler in AS, open and close popups, and verify no leaks
Change-Id: I2d4a87f0481cbc88f3587dce91278e85ca113545
This reverts commit 242c805f82.
Reason for revert: Introduces a leak. I haven't seen a bug for it yet, but this CL is the only in the culprit list; the leak can block multiple teams presubmits, and the leak is via ArrowPopup. Enough evidence.
https://fusion2.corp.google.com/invocations/4b50db71-d598-4e52-9076-e91d42b65014/targets
Change-Id: I1700a9eea8705983598aee43c0a63e67c1d9cf71
Bug: 187075409
- Updated logic to accept any view that is a a child of draglayer
(from being workspace dependent)
- Move color extraction logic from widget class to utility class.
- Initial CL, future CL will interpolate between colors
and expand color extraction to other abstract floating views.
Bug: 175329686
Test: long press on colorful wallpaper and test colors are extracted
test in multiwindow mode
Change-Id: I18a6bb5013de4eea7e9b45810401f5b9b3cd7302
Instead of recalculating the orientation after adding margins,
we account for the margins in the initial calls to orientAboutObject.
This ensures consistent mIsAboveIcon throughout calls to show the popup.
- Also updates the smaller radius to match the middle items.
Bug: 175329686
Test: long press on item where height and height without margins would
result in differing mIsAboveIcon values
eg. the 3rd item in a folder in the top middle of 5x5 workspace
Change-Id: I6132b544a89c7948339d17f219ad75c797233f55
- Colors interpolate between the primary and secondary popup colors
- Removed condensed height and icon scale
Bug: 175329686
Test: visual, manual checking apps with different shortcut options
Change-Id: I064c329dc8ad3ae6f408056c74372cca3ce20b68
- Removed divider views, using margin to separate views
- Removed elevations
- Added a ViewGroup to hold all notification views, and applied an outline
Bug: 175329686
Test: visual
Change-Id: Iad70dcfdaeba6050c2b17c07f76bb7bfb728e544
Bug: 175329686
Test: open home menu, notice no arrow
open long press menu, notice arrow still visible
Change-Id: I3f480d570b5134376324d4b8051da639ee8d8b27
Adjusts layouts to accommodate more rounded dialogs, includes adding a
new rounded triangle drawable that can be clipped by a rounded rect.
Bug: 179922117
Test: checked all instances and RTL
Change-Id: I4c2f0ead0fd56eba14ffd9b82f0c100f7d92ef5b
These do not work well with gesture-nav and can potentially
block the Launcher UI.
Instead exposing on custom actions with keyboard accelerator and
using thee internal arrowPopup for resize options
Fixing SecondoryDropTarget not sending appropriate stats log
Bug: 179854703
Test: Verified on device
Change-Id: I268690f8a937896e4350496128a38959003f8939
Test: manual
Fixes: 160190991.
Reordering the workspace's popup menu items breaks muscle memory of getting to the wallpaper and home settings. Added ArrowPopup#show and refactored ArrowPopup#reorderAndShow to allow more flexbility.
Change-Id: I3fa327d08488a52312c86769bb9a065ccacb17aa
Here, the first item in an ArrowPopup or Folder are focused on.
Note: There's another pre-existing bug where it announces
"Home screen x of y" when the floating view appears; this
change doesn't address that.
Fixes: 147470419
Change-Id: I1dc70edc21ea7c19a5742208512738d6c4a94067
> Launcher uses realSize, availableSize and insets to calculate
various layout values. Without drawing behind cutouts, these values
are not consistent (insets + availableSize != realSize) leading to
jumps in layouts.
> Removing fake black bars in low-ram devices to avoid inconsistent
insets.
> Fixing various layouts not taking lert/right insets into account.
Bug: 156268804
Change-Id: I8441db8a468b08a65b57b932050b5b4b37313966
orientAboutObject() currently determines whether the popup should align
its left side with the icon or the right side. However, after
determining this, there is an offset to ensure the popup lines up with
the icon as expected, which might push it out of bounds. In that case,
we fallback to centering the popup. However, there might be plenty of
room on the other side, so we should just align the other direction
instead. Updated the logic to do that by first trying to align left
(in LTR) or right (in RTL), then trying again with the other alignment
if it doesn't fit after all x calculations are made.
Bug: 150644839
Change-Id: I219dae331bf790e461d91394ffe025d40ec54c9b
Generally mEndRect is still correct from when we set it in
animateOpen(), but there are cases where it is no longer valid and
should be recomputed in animateClose(). For example, if you dismiss
notifications, the height of the popup changes between opening and
closing it.
Test: Long press an icon with a notification dot, dismiss all
notifications from the popup and then close the popup. The shadow
follows the outline of the popup, instead of extending well below it.
Change-Id: Ic5d6ad2807ea1ec8aff5e3d6ce8abaa11ce5d33c
This currently includes the menu that pops up when
long pressing an app icon in Launcher or Search, or
long pressing Smartspace. Previously, only the menu
for Launcher apps grabbed accessibility focus after
the open animation completed, and now all three do.
Fixes: 145253300
Change-Id: I147b45d38a04ab9a55eee9b5bd5551b4c7185fcf
Some background on what was happening:
- When mEndRect.isEmpty(), we set it to (0, 0 , width, height)
- We called mEndRect.setEmpty() in animateClose(), but override
mEndRect if the reveal animation set the outline bounds.
- But the reveal animation doesn't set the outline bounds until
after the arrow animation (40ms) finishes, i.e. the arrow scales
up for 40ms then we clip to outline and start revealing the popup
- Thus, if you started a drag before the arrow animation finished,
we called mEndRect.setEmpty(), which made the close animation start
from the full popup size even though it was previously invisible.
To fix this, we clip the popup to its (empty) outline while the
arrow animates in, and then we can always start from wherever the
outline currently is when we close the popup.
Test:
- Set animation duration to 10x
- Long press an icon, and start dragging before the arrow scale
animation finishes
- The popup never shows, whereas before it jumped to full size
Bug: 143639898
Change-Id: I284dd06a23e0e9c3faf066a0083ac13bac88ebcc
The fade in animation doesn't change the alpha until the reveal animation
has started — so when animators are turned off the alpha never gets updated.
Bug: 124252507
Change-Id: I19bb77e16389ff870e05692b1aea8483033485ac