Commit Graph

96 Commits

Author SHA1 Message Date
Hongwei Wang
500043a457 Merge "Implement PiP custom close action on phone" into tm-dev 2022-04-20 17:37:44 +00:00
Chilun Huang
dc7c91de99 Merge "Use the icon size of starting surface for split decor" into tm-dev 2022-04-20 08:44:33 +00:00
Hongwei Wang
dd51f86fd4 Implement PiP custom close action on phone
To use this new custom close action on Phone
- We expect app providing actions via
  PictureInPictureParams.Builder#setActions as they normally do
- We also expect app providing a custom close action via
  PictureInPictureParams.Builder#setCloseAction
- The custom close action is used on Phone only if it matches one of the
  actions listed in setActions (by comparing the PendingIntent)

SysUI will render the custom close action with a highlighted background
and ensures the PiP dismisses after certain timeout if the app fails to
respond in time.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/fR0hxeorlYrxXyzfZ02btK
Bug: 223896879
Test: see video
Change-Id: I65c585ae3224061311e476753bc4c72f00c4fa33
2022-04-19 23:55:06 -07:00
Chilun Huang
2384beb3fa Use the icon size of starting surface for split decor
Use a fixed icon size and fit to centor scale for split decor to avoid
unexpected icon size. Also sync the same icon size to drop zone area.

Bug: 228928242
Test: Manual resize the split and check the icon size.
      Manual drag to split and check the icon size.
Change-Id: Idaf523810e3913a22787925817b6013464818147
2022-04-14 20:32:06 +08:00
Galia Peycheva
c24734e830 Add edu text to TV PiP
The edu text is added to the bottom of the TvPipMenuView, below the
pip content. This also makes the front and back pip menu surfaces
change size while the edu text is showing. It is shown for 10 seconds
and after that it is hidden by sliding upwards. This repositions the
PiP window so that it is placed properly (centered in case of expanded
pip).

This change introduces temporary decor insets - this is for the edu
text. Temporary decor insets don't interfere with the keep-clear area
algorithm - they will not cause the pip to move if they intersect with
a keep-clear area. They are only taken into account when calculating
the anchor bounds. Permanent decor insets are also taken into account
when calculating intersecting keep-clear areas

Bug: 219884907
Test: manual - start pip and check that the edu text is displayed and
      goes away after 10 seconds
Change-Id: Ie27c633c517903a4bf0b1544626bd00b621c19d4
2022-04-04 14:33:07 +02:00
Galia Peycheva
d2d5e68312 Add Tv Pip rounded corners tray
This CL adds a permanent grey border around the pip surface, which
has rounded corners, and a backing surface, with the same color as the
border. This way the pip surface is sandwiched between the two pip menu
surfaces

Bug: 219883374
Test: m && open app in expanded pip && move pip to opposite edge
    && start dream && wake up dream && toggle expanded pip
Change-Id: Idf22ca22044e7e5e3ca6b39326e3afb76e3ee43c
2022-04-04 14:32:32 +02:00
Mady Mellor
9052b5c2fe Adjust the sizes of user education for large screens / landscape
When the stack is expanded on large screen devices, the bubbles are
inset from the edge of the screen. Due to this the rounded corner
on the user education view for the manage button is kinda squished
with the text. To make this look better, increase the width of this
user education view when on large screens. Use this value for
landscape on phone as well because we were doing match parent in
that scenario and it looks bad.

Additionally, on all form factors, increase the padding at the end
of the view. This makes it look a little better especially for
languages where the words can be long.


Bug: 223635730
Test: visual - force user education to show for bubbles, take a look
               at how the stack & manage user education views look
               on tablet and phone (in landscape and portrait).
Change-Id: I7bcdfff7341b8c6acad0f6f5fdcbc7fd24aa4627
2022-03-22 18:50:08 +00:00
Mady Mellor
3a0688ed8b Update the bubble overflow to match new visuals
* The overflow has a more restricted size than previous and this size
  should be used even on large screens, not just in phone landscape.
* Updates the padding between columns & rows in the overflow view
* Reduces the line length of items in the overflow

Test: visual - look at overflow on large tablet, small tablet and
               phone across configurations
Bug: 217211205
Change-Id: I8fe8b0bd8b6c07393583d81540506a74eaa4fc10
2022-03-02 19:56:06 +00:00
Tom Natan
e10d3a41a7 Merge "[13/n] Letterbox Education: change dialog width and handle oveflow cases." 2022-02-14 17:54:59 +00:00
tomnatan
c989a1b38c [13/n] Letterbox Education: change dialog width and handle oveflow cases.
We set the dialog width to the maximum between 472dp (to be consistent with the standard android dialog width) and the task width minus margin.

We also add a 16dp margin between the dialog container and the task
stable bounds (task bound excluding insets).

Overflow in width will be handled by texts wraping to multiple lines and
overflow in height will be handled by making the dialog scrollable.

In addition, a 500ms start delay is added to enter animation.

Bug: 215314668
Test: N/A
Change-Id: I4b11096e124ae8632bff6390700e7519acdcefa0
2022-02-14 15:48:19 +00:00
Galia Peycheva
c6876ff4c8 Implement expanded PiP on TV.
- Launch into expanded PiP
- Let user toggle expanded PiP in Menu
- Update moving the PiP via DPAD for expanded PiP
- Let app dynamically change the expanded PiP aspect ratio
- Let app dynamically change the PiP aspect ratio
- Let app dynamically enable/disable expanded PiP

Bug: 203647003
Test: atest PinnedStackTests#testEnterExpandedPipAspectRatio
Test: atest PinnedStackTests#testEnterExpandedPipAspectRatioMaxWidth
Test: atest PinnedStackTests#testEnterExpandedPipAspectRatioMaxHeight

Change-Id: Ie7de6a7fcc424b0c086fdae1f66aa8de42e53b0c
2022-02-14 09:04:20 +00:00
tomnatan
4a463aaab8 [7/n] Letterbox Education: add enter/exit animation to the dialog.
Bug: 207010227
Test: N/A
Change-Id: Ie5f88b97c16a7bd043c6c63a8693415563b56a54
2022-02-09 00:23:19 +00:00
tomnatan
bf5b7b2dd3 [5/n] Letterbox Education: update the dialog layout.
In addition, remove the overlay layout and include it in the dialog
layout as the background of the top-level layout (renamed as dimmer).

Test: N/A
Bug: 207010227
Change-Id: I658e85378ec266c4260b520b5fcdddbfb66b35c6
2022-02-08 10:36:28 +00:00
tomnatan
6f31ad815b Letterbox Education: Cleanup the toast layout.
The toast is no longer needed since we decided to only show the
letterbox education once as a dialog.

Test: N/A
Bug: 207010227
Change-Id: I1dccf10d0effad111d8ee8e62a068e4dee571c20
2022-02-02 11:29:45 +00:00
Tom Natan
26b7cb8e11 Merge "[1/n] Letterbox Education: Add UI layouts" 2022-01-25 14:22:32 +00:00
tomnatan
51127d083d [1/n] Letterbox Education: Add UI layouts
Test: N/A
Bug: 207010227
Change-Id: I9806121fcd0c6b3432dd5faf98b99bf9cfb747f5
2022-01-25 09:07:03 +00:00
Jacqueline Bronger
481026d372 Merge "Move PiP via DPAD to the four corners (TV)" 2022-01-13 10:11:10 +00:00
Jacqueline Bronger
f5863c14b1 Move PiP via DPAD to the four corners (TV)
Bug: 203641195
Test: manual
Change-Id: Ib2381ae6ff0b43f444af8e984a4f0e6d9786169b
2022-01-12 17:23:08 +01:00
Jason Chang
fbb89d8c65 Merge changes from topic "new-ohm-bg-panel"
* changes:
  (2/n) Implement BackgroundWindowManager to manage tutorial background
  (1/n) Phase out FEATURE_ONE_HANDED_BACKGROUND_PANEL
2022-01-12 15:33:21 +00:00
Jason Chang
6d4fc4ca09 (2/n) Implement BackgroundWindowManager to manage tutorial background
Using WindowlessWindowManager for adding a surface wihtout depend on
Window Hierarchy, we just add leash with specific theme color at
bottom z-order while One-handed trigger, and remove it when exited.

Bug: 197165590

Test: manually test One-handed mode basic operations.
Test: atest WMShellUnitTests
Change-Id: Ie53684edd4511719516c00dd64c2dfad360a593b
2022-01-12 11:44:19 +08:00
Mariia Sandrikova
d2ccf6edac Merge "[5/n] Camera Compat UI: Unify margins logic for camera and size compat controls." into sc-v2-dev am: b6c52ec273 am: 0cb2c45802
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16527687

Change-Id: I0cf5f6fa171d2cd9f402cd1439c3418631718cc9
2022-01-07 11:23:05 +00:00
Ats Jenk
2ae3ef7465 Merge "Use ConstraintLayout for BadgedImageView" 2022-01-04 23:17:51 +00:00
Mariia Sandrikova
d8cbcc46be [5/n] Camera Compat UI: Unify margins logic for camera and size compat controls.
Before this change, margin between a hint and a camera compat control was smaller than required 8 dp while for a size compat control it was bigger than 8dp (since ag/16420818). This change makes them consistent and also simplifies layout definition for the size compat button by declaring margings explicitly rather than including them in width and height implicitly.

Test: manual
Bug: 206602997
Change-Id: I09839e764d2c8904954a594433888bfdc21d56ba
2021-12-23 18:37:59 +00:00
Mariia Sandrikova
d77c92a3f1 Merge changes from topic "camera-compat" into sc-v2-dev am: 3486eacda3 am: 02a17e7b1f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16468379

Change-Id: Ic9916a3883eef0148a86c86149aa2e883fc56d1b
2021-12-18 22:19:12 +00:00
Mariia Sandrikova
13e80fd997 [3/n] Camera Compat UI: Add a camera compat control.
Test: atest WMShellUnitTests
Bug: 206602997
Change-Id: Id9b9a89303387c4ac797fc1382967151a13d38ef
2021-12-17 00:20:19 +00:00
Ats Jenk
f33f1daf62 Use ConstraintLayout for BadgedImageView
App icon badge size is based on the view size, as a ratio.
Use ConstraintLayout to define the app icon size based on constraints.
This way we do not have to recalculate the app icon size manually.
If the BadgedImageView size changes, app icon will be resized automatically.
App icon badge position is fixed to the right. If it needs to be shown
on the left, due to bubble position, we update the location using
translationX.

Bug: 162857077
Test: verified visually that bubble with app icon looks the same
Test: verified visually that when display size changes, app icon changes
  together with bubble size
Test: ran WMShellUnitTests unit tests
Change-Id: I63a6cadfc7847dd0c0d9dca6bb6efd11f5b9958e
2021-12-16 10:30:30 -08:00
Mariia Sandrikova
ef1f033720 Merge "[1/n] Camera Compat UI: Refactor size compat mode UI controller." into sc-v2-dev am: aa7a8cdda5 am: 6863643cda
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16420818

Change-Id: I63c10a663aea9471594af90d1c59c57f8bef1e1c
2021-12-12 17:15:30 +00:00
Mariia Sandrikova
6dd79270b0 [1/n] Camera Compat UI: Refactor size compat mode UI controller.
First CL in the chain that will add a camera compat UI control which will be used to correct stretched issues in TextureView and SurfaceView cause by apps not handling mismatch between camera buffers and view size correctly.

This change is necessary because right now there are 2 instances of WindowlessWindowManager (SizeCompatUIWindowManager) in SizeCompatUILayout: for a hint and for a restart button. They are also positioned relatively by computing offsets in java code rather than by specifying layout with XML. This code structure will cause issues since with upcoming camera changes there will be a need to coordinate relative position of 4 UI elements (2 buttons and 2 hints).

What is changing in this CL:
- Majority of changes are simple renaming from "size compat UI" to "compat UI" since, starting from the next change, two different compat controls will be supported.
- Merging 2 instances of SizeCompatUIWindowManager into one (CompatUIWindowManager) and for that create a joint layout in compat_ui_layout.xml
- Merge SizeCompatLayout logic into CompatUIWindowManager since in absence of 2 instances of WindowlessWindowManager there is no good reason to keep them separate.
- Merging and renaming tests to follow refactoring of the implementation.

Test: atest WMShellUnitTests (the same set of tests should be sufficient since this refactoring just reorganized the structure of the implementation)
Bug: 206602997
Change-Id: I7141c69b7ba4742c5b7b2018329b91a1b37b45bc
2021-12-11 13:00:23 +00:00
Jacqueline Bronger
1eeea7c0c5 Tv pip menu design update (1)
PiP window stays where it is instead of moving to the center and
the menu buttons are shown on centered on the pip instead of below
the window.

Additionally disabled menu items are removed to avoid cluttering.

Bug: 201270615
Test: manual
Change-Id: I9af5dc04dd0999d61add88a3475c697b376034d0
2021-12-08 14:24:19 +01:00
tomnatan
d9f722d0d4 Change the restart button to use material colors
In addition, add a ripple effect to the button.

Fix: 198347324
Test: N/A
Change-Id: Ibd33f32cf4908ae9d3d02d8043e625e24123aff7
2021-11-19 16:57:49 +00:00
Ben Lin
6d6a81b5e8 PiP: Enable enter split.
Bug: 202740657
Test: Enter PIP, open another app, tap "enter split"
Change-Id: Ifd30489705c8a928aa8e219cb0d88fdd2b932c6d
2021-11-11 14:01:14 -08:00
Hongwei Wang
5b3d8a3aaf Revert^2 "PiP: support direct entering split from PiP."
a6abf3067b

Change-Id: I1deddacd0ef7ba36b55d38d14718d0be90129866
2021-11-10 21:02:08 +00:00
Hongwei Wang
a6abf3067b Revert "PiP: support direct entering split from PiP."
Revert "Update PiP signatures"

Revert submission 16190721-pip-enter-split

Reason for revert: regression b/205639175
Reverted Changes:
I62d1617c1:Update PiP signatures
I0829c910b:PiP: support direct entering split from PiP.

Change-Id: I52fe160c50747a00e1d30b072ce07e67dae9c6de
2021-11-08 18:52:00 -08:00
Ben Lin
5574121d03 Merge "PiP: support direct entering split from PiP." into sc-v2-dev 2021-11-05 17:42:02 +00:00
Sergey Serokurov
34ba68727c Merge "In overflow view, set bubble name TextView width to a fixed value" into sc-v2-dev 2021-11-04 23:34:25 +00:00
Ben Lin
0e40a98bc3 PiP: support direct entering split from PiP.
Add a new "enter split" button that allows user to go directly into
split screen on large screen devices from PiP.

- Add button
- Calculate split-screen location based on current PiP bounds
- Merge all WCT into one after animating

Video: http://recall/-/gu5DjQFZPMFpwgaXdl4cV3/gnNkSpC72tlTGP2mrKR07R

Bug: 202740657
Test: Enter PIP, open another app, tap "enter split"

Change-Id: I0829c910b2873ed4c4b0ea4fe0ca28b7f87736d8
2021-11-04 11:45:59 -07:00
Sergey Serokurov
c996d270b4 In overflow view, set bubble name TextView width to a fixed value
Bug: 198539434
Test: Manual, verified that bubbles in the overflow view are evenly spaced
Test: screeshot before the fix: https://screenshot.googleplex.com/6RRa6qoTbFrJfCC.png
Test: screeshot after the fix: https://screenshot.googleplex.com/BmdPN6AvXedYFNE.png
Change-Id: Icba048b65591e186d579a2c56685499fea316e9f
2021-11-03 21:16:40 -07:00
Tom Natan
2d213c397a Merge "Redesign the size compat restart button according to mocks." into sc-v2-dev 2021-11-02 15:22:05 +00:00
tomnatan
825e55ed60 Redesign the size compat restart button according to mocks.
The width of the hint is constant but the height changes with respect to the number of lines the text requires (see screenshots below). The X position of the hint is set programmatically so that the point's center will be aligned with the button's center.

Still need to add UI for different states of the button (pressed, focused, etc.) and maybe also the hint (since it's clickable). Mocks for this are still TBD.

Mocks: https://www.figma.com/file/fLAVOdDkg0lnFWiltSYbGA/Multitasking?node-id=2719%3A54196

Screenshots:
[default - 2 lines]    http://screen/4EtytFiKsY3Q5NE
[LTR language]         http://screen/9BSPipZYUd7UGPV
[short text - 1 line]  http://screen/AN5bds6rh5V55Bw
[large font - 3 lines] http://screen/6utG596y52LBDjX
[long text - 4 lines]  http://screen/7mBL2fXWy43UsTq

Bug: 198347324
Test: atest WMShellUnitTests:SizeCompatRestartButtonTest
Test: atest WMShellUnitTests:SizeCompatHintPopupTest
Test: atest atest WMShellUnitTests:SizeCompatUILayoutTest
Change-Id: Ida4c4171be94b60499cfe8acb6a2278f7e10a1f3
2021-11-02 13:17:19 +00:00
Jerry Chang
222c9d3890 Update split resizing transition to match design
Remove the support of drawing side stage outline and update
OutlineManager to SplitDecorManager to help rendering decor view for
split screen like providing resizing hint.

Fix: 202740435
Fix: 202174975
Bug: 201653912
Bug: 200850654
Test: atest WMShellUnitTests
Test: manual check split resizing behavior

Merged-In: I4033255d8e2a94f69667ca1365b17da956816cde
Change-Id: I4033255d8e2a94f69667ca1365b17da956816cde
2021-10-27 23:22:33 +08:00
Jerry Chang
08ac74f125 Consolidate the behavior and style of side stage outline
Update the style of side stage outline to match the current design. And
make sure the outline will interact properly with task bar expanding,
collapsing, swipe up, drag to split, recents shortcut to split and drag
divider bar to resize gestures.

Bug: 200850654
Test: atest WMShellUnitTests
Test: enable side stage outline, observed it behaves properly.
Change-Id: I3f0795adc34a0efb19d35b78d54364da4189a043
2021-10-04 11:06:59 +08:00
Jerry Chang
8675afb2c4 Align rounded corners beside divider bar with display and task bar
Use the same way to draw rounded corners beside divider bar with
display and task bar to make sure all rounded corners share the same
style.

Bug: 196272915
Test: atest WMShellUnitTests
Test: manul check the rounded corners rendered in proper position.
Change-Id: I566ef5233dc345e0229fd9637c3b05705ba35864
2021-09-17 22:58:27 +08:00
Jerry Chang
5514e76d40 Draw rounded corners beside split divider bar
Draw rounded corners beside divider bar which inset with task bar if
the task bar is expanded.

Bug: 196272915
Bug: 182511830
Test: atest WMShellUnitTests
Test: manul check the rounded corners rendered in proper position.
Change-Id: I14c5a9416d52bf06b3e4c8ac843c5a65c0b940b8
2021-08-30 19:39:03 +08:00
Jerry Chang
074c7291a9 Update divider bar layout to match stage split design
Bug: 197361088
Bug: 196272915
Test: manual
Change-Id: Ic2fed9c6ef5d8004f922d766c7e3d3170846041d
2021-08-27 04:22:22 +00:00
Mady Mellor
204080732f Updates to user education for large screen
- Restrict the width of the education views when
  on a large screen device
- Rather than hardcode the position / padding for
  the education views, figure it out based on where
  the view is on the screen so that it's a little
  less brittle.
- Recreate the views for theme or display size change

Test: visual - verify the user education screens
               look correct in phone and on large screen
               in both portrait & landscape
             - change display size & verify education
               is still visible & sized appropriately
Bug: 186776550
Change-Id: I1c77a810339448d61b570eb158848c15b2df96c8
2021-08-09 10:56:20 -07:00
Mady Mellor
ba35a77513 Updates to manage button based on latest mocks
- manage button should be inset from the expanded view edge
  but the menu should be flush with expanded view edge.
- button size is smaller (36dp instead of 40dp)
- more padding (16dp above / below on both tablet & phone)
- diff colour N1-800 instead of N1-900

Test: visual 1 - expand a bubble and look at 'manage' button
             2 - tap on the button and look at the menu
             3 - do 1 & 2 on tablet & in RTL & on phone
                 landscape
Bug: 183658858
Change-Id: I4b5ffc26602b72ee28d26476fc222df3e2e1e80b
2021-08-02 12:20:08 -07:00
Mady Mellor
57a3e448f6 Merge changes Ie7aaec55,I3053cdb6 into sc-v2-dev
* changes:
  Remove BUBBLE_EXPANDED state from ScrimController
  Manage menu changes
2021-07-30 16:47:43 +00:00
Mady Mellor
0974348d31 Manage menu changes
- padding & size updates
- scrim between bubble expanded view and the manage menu

Test: manual - expand a bubble, tap on the manage menu, it
      should animate in with a scrim behind it.
Bug: 183658858
Change-Id: I3053cdb61497434a0aeb49eb33f87a3dafb364d7
2021-07-29 12:46:19 -07:00
TreeHugger Robot
9d1f00944b Merge "Apply theme color and fade-in transition effect at the top of One-handed mode" into sc-dev am: a08d1cb0f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15234619

Change-Id: I544c9b53f7475690b4ff898e8455d893411d2c06
2021-07-28 14:43:57 +00:00
Jason Chang
966382b0c9 Apply theme color and fade-in transition effect at
the top of One-handed mode

1. Implement the Dynamic color theme at the top Tutorial area
but the color should not be the same as the recents UI.

2. Do not translate Tutorial icon & text vertically, then provide
quick subtle fade-in effect for Tutorial window.

3. Apply new icon for tutorial.

Bug: 193126258
Bug: 193589897

Test: Local verify when changing dark theme and wallpaper theme.
Test: Local verify Tutorial icon & text fade-in effect.
Test: atest SystemUITests
Test: atest WMShellTests
Test: Perfetto check enter & exit performance
Change-Id: I60f4e7a709f3a27fe6c7f480f1012caccdbbe5ec
2021-07-22 23:00:06 +08:00