Commit Graph

57 Commits

Author SHA1 Message Date
Suphon Thanakornpakapong
28df5361d4 Fix build 2022-05-08 21:31:31 +07:00
Suphon Thanakornpakapong
11e1a2fdc8 Merge remote-tracking branch 'aosp/android12L-release' into 12.1-dev 2022-05-08 20:29:17 +07:00
Thales Lima
45f2306ce9 open grid task menu to the right of icon
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
2021-11-18 12:01:16 -03:00
Thales Lima
c335ad28a2 launcher: use a different task menu for foldables
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
2021-11-10 17:30:13 +00:00
Greg Kaiser
24898d3be0 Revert "launcher: use a different task menu for foldables"
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
2021-11-05 16:19:05 +00:00
Thales Lima
10eb3cd98b launcher: use a different task menu for foldables
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
2021-11-04 16:40:37 +00:00
Suphon Thanakornpakapong
47a10063f0 Theme ui elements using accent color palette 2021-10-14 23:57:17 +07:00
Brian Isganitis
3fca6717ed Merge "Only set arrow color once when below icon." into sc-v2-dev 2021-09-29 19:57:23 +00:00
Brian Isganitis
8b678206cf Only set arrow color once when below icon.
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
2021-09-29 12:30:50 -04:00
Brian Isganitis
1e34f65395 Update arrow color after all notifications dismissed.
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
2021-09-29 16:29:16 +00:00
Brian Isganitis
a85ae69c72 Refactor arrow popups to allow easier code overriding and sharing.
Test: Existing menus work as intended.
Bug: 188222480
Change-Id: I7d19b06ce8bb7d765624c64c0042c4efd6faf348
2021-09-24 20:32:14 -04:00
Jonathan Miranda
8bcbb662bb Merge "Allow users to dismiss notifications in popup view." into sc-qpr1-dev am: 2f9f6378be
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15690344

Change-Id: I438d4193b9a4ef33613f37e7a4ae30d3f663e6bb
2021-09-02 16:48:46 +00:00
Jon Miranda
f3bbd98bf8 Allow users to dismiss notifications in popup view.
Bug: 193014051
Test: - dismiss notifications (left/right)
      - open popup, dismiss notification from shade
        and ensure popup gets updates
      - open popup, trigger new notification
        and ensure popup gets updated

Change-Id: Iea4d458218cbf5cb22f5f89aa0a4cc1bee18cc73
2021-08-30 20:38:16 +00:00
Sunny Goyal
69a8eecdc9 Simplifying color extraction registration logic
> 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
2021-07-28 15:43:13 -07:00
Jon Miranda
fa73c02172 Set elevation of popup and arrow to match. This ensures no shadow overlap.
Bug: 191823198
Test: long press app where arrow is on top and bottom in:
      workspace, all apps, and search UI

Change-Id: Icc4ac259607175d5e12447a844ba166ba28b74af
2021-06-29 15:49:46 -07:00
Jon Miranda
6a936e3ec4 Update colors for non-v31 devices.
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
2021-06-24 11:07:52 -07:00
Jon Miranda
27de7d2643 Update popup colors. Add local color extraction behind a flag.
- 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
2021-06-23 14:18:25 -07:00
Jon Miranda
f13ddbd333 Fix bug where ripple extends out of bounds in pop up container.
Bug: 186820908
Test: test apps with diff. pop up container arrangements
      test prefs in all apps

Change-Id: I4d3e26871416835ab2a851fcc6fe2c4f70235b62
2021-06-18 20:58:14 +00:00
Jon Miranda
32ff76cb4e Adding color back to popup container.
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
2021-06-10 19:15:24 +00:00
Jon Miranda
35c5477d5c Remove color extraction from popup arrow, add shadows.
Bug: 175329686
Bug: 187014675
Test: manual

Change-Id: I84a3f23b7a9ceef004a2b1b66e5f8a10585bd113
2021-05-11 17:35:01 -07:00
TreeHugger Robot
f2247f199f Merge "Add method to check if popup supports color extraction." into sc-dev 2021-05-11 01:55:45 +00:00
TreeHugger Robot
32ee8c6a51 Merge "Add local wallpaper color extraction to folder backgrounds." into sc-dev 2021-05-09 04:02:12 +00:00
Jon Miranda
94e43bd7d8 New motion for ArrowPopup open/close.
Bug: 175329686
Test: long press on apps where container opens above & below
      and where container is aligned left & right

Change-Id: I09bbf57b6e19cc6f022b9a96fb48d8c4ae080813
2021-05-07 19:33:22 -07:00
Jon Miranda
0b6fa71deb Add local wallpaper color extraction to folder backgrounds.
- 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
2021-05-07 16:16:36 -07:00
Jon Miranda
2955fa8f5c Add method to check if popup supports color extraction.
Bug: 187058092
Test: manual
Change-Id: I795cd3bfd04a7ab9b4730a2e7d7618830faae37e
2021-05-05 11:20:20 -07:00
Jon Miranda
88b7f6a0d5 Move color extraction utils to extractor class so each instance can
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
2021-05-04 09:00:01 -07:00
Jonathan Miranda
21930da9a2 Revert "Revert "Use color extraction for arrow popup.""
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
2021-05-04 08:53:58 -07:00
Vadim Tryshev
17fda29bf3 Revert "Use color extraction for arrow popup."
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
2021-05-03 18:27:41 +00:00
Jon Miranda
242c805f82 Use color extraction for arrow popup.
- 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
2021-04-30 15:54:17 -07:00
Jon Miranda
a3c8662a56 Use separate color for popup when on top of another surface (folder/all apps).
This ensures the two surfaces contrast.

Bug: 175329686
Test: long press on item in folder
Change-Id: Ic2ac9c433ce219452024071388fa0cfb51487fb6
2021-04-26 17:59:21 -04:00
Jon Miranda
116e94e0a7 Account for children margins when orienting popup container.
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
2021-03-19 18:30:03 -04:00
Jon Miranda
2a58d13b9b Add separate background colors to each popup container child.
- 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
2021-03-19 13:41:07 -04:00
Jon Miranda
c79316740b Update deep shortcut to new ui.
- 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
2021-03-18 11:09:34 -04:00
Jon Miranda
e92a4add99 Do not add arrow to OptionsPopupView.
Bug: 175329686
Test: open home menu, notice no arrow
      open long press menu, notice arrow still visible
Change-Id: I3f480d570b5134376324d4b8051da639ee8d8b27
2021-03-12 16:46:08 -05:00
Zak Cohen
452005a14e Update ArrowPopup to accommodate more rounded dialogs.
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
2021-02-25 16:59:55 -08:00
Sunny Goyal
384b578ab2 Removing menu and dialog for custom actions hanlding.
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
2021-02-16 10:45:06 -08:00
Winson Chung
f99351888c Revert "Revert "Merge commit '8d14dbe041199d611839140f1c9285fd4174e9f4' ...""
This reverts commit 087a9e39b6.

Change-Id: I05b17a6e4aaaef6de3c2fa26aad45a39eb2833f9
2020-10-23 09:27:48 -07:00
Alistair Delva
087a9e39b6 Revert "Merge commit '8d14dbe041199d611839140f1c9285fd4174e9f4' ..."
Revert "Merging from ub-launcher3-master @ build 6877130"

Revert "Merging from ub-launcher3-master @ build 6877130"

Revert "Merging from ub-launcher3-master @ build 6877130"

Revert submission 12738409-merge_ub-launcher3-master_6877130

Reason for revert: Introduced crashes to global presubmit

Reverted Changes:
I624658ce6:Merge commit '8d14dbe041199d611839140f1c9285fd4174...
Iccd2f1e3a:Merging from ub-launcher3-master @ build 6877130
I791d64951:Merging from ub-launcher3-master @ build 6877130
Icdd32ab01:Merging from ub-launcher3-master @ build 6877130

Bug: 169963211
Change-Id: I77a4ae59e823147beae8dd7cb9b54ccdace2c7f4
2020-10-05 14:46:26 +00:00
Schneider Victor-tulias
1b17d6be20 Make the workspace popup menu items statically ordered.
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
2020-09-25 16:03:05 -07:00
Andy Wickham
bc83edbf4d Allows Accessibility to focus on specified view in AbstractFloatingView.
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
2020-06-10 12:03:43 -07:00
Sunny Goyal
786940ae93 Allowing Launcher to draw behind cutouts
> 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
2020-06-05 00:25:58 -07:00
Tony Wickham
ddb08885f9 Try orienting popup the other way if offset pushes it out of bounds
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
2020-03-11 12:27:44 -07:00
Tony Wickham
e6981a606a Update mEndRect when closing ArrowPopup
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
2020-02-24 17:33:20 -08:00
Andy Wickham
27d3c595cf Makes all ArrowPopups AccessibilityTargets.
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
2020-02-20 20:36:16 +00:00
Sunny Goyal
9c2b96090b Adding SecondaryDisplayLauncher in Launcher using common listener
Bug: 141596722
Change-Id: I480bfadf592f7d0309f17c33a3fe14bb77fb5586
2020-01-30 08:27:27 +00:00
Tony Wickham
6894f4f1bb Fix issue where popup jumps to full size before closing
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
2019-11-01 15:53:52 -07:00
Hyunyoung Song
2aec9c42f5 Change task view / all apps/ widgets / folder radius to dialogCornerRadius
Bug: 123985787
Change-Id: Iaa8088beb51d37dba90d57ad065f9eac0dd46270
2019-04-09 00:27:07 +00:00
Hyunyoung Song
ce37ee5c97 Change the corner radius of ArrowPopup containers
Bug: 123985787
Change-Id: Ibcdd25d2795743225579e8ebc48a4511472f87d8
2019-04-05 13:44:01 -07:00
Jon Miranda
13d6dd8dc1 Ensure ArrowPopup alpha is set to 1 at the end of the opening animation.
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
2019-02-12 11:03:06 -08:00
Vadim Tryshev
fdfeb6dd3b Moving Pause button to the left of the context menu header
See this mock:
https://www.google.com/url?q=https://docs.google.com/presentation/d/1AepsnLeKcRhjMW35SkB5yMKO3u6waigug8Tyfe0LO5o/edit%23slide%3Did.g455d187f2a_0_45&sa=D&ust=1542320415002000&usg=AFQjCNH-jsy5THG1WqxjeYbj628QFMJKvQ

Bug: 117888000
Test: Manual
Change-Id: I1edbc569347f09f0806ad6749735c3dec198277a
2018-11-26 14:30:52 -08:00