Commit Graph

110 Commits

Author SHA1 Message Date
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
Galia Peycheva
49f5f057b6 Merge "Add edu text to TV PiP" into tm-dev 2022-04-05 06:01:26 +00:00
Galia Peycheva
b26603d090 Merge "Add Tv Pip rounded corners tray" into tm-dev 2022-04-05 05:59:14 +00: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
Hongwei Wang
2708c3a74d Handle PiP shadow radius in WMShell
Deprecate also the shadow radius for PiP in Task

Bug: 206508708
Test: Verify the PiP enter/exit/move/resize transitions
Change-Id: I8ff83dd4e626a3455373fed6c908cf131ecae8fe
2022-03-28 16:43:46 -07:00
Mady Mellor
139a3c1803 Merge "Adjust the sizes of user education for large screens / landscape" into tm-dev 2022-03-23 18:25:45 +00: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
Jacqueline Bronger
aa3a7e6273 Implement custom PiP close action on TV.
The custom close action will replace the system close action and
the button in the menu will be colored red to be able to tell it
apart.
If one of the custom actions matches the close actions it will be
removed to avoid duplicates resulting from the custom close action.

If the app doesn't close the PiP after five seconds the system will
continue to close the PiP as normal.

Bug: 218487423
Test: manual
Change-Id: Ic3c520c50ac0e3d2f0e73cf2f71d47a4f548f861
2022-03-16 16:32:02 +01:00
Galia Peycheva
9258090943 Add string for tv pip edu text
Bug: 219884907
Test: m
Change-Id: I51e8a0d69954a7f9d7b3cf9d4423ddad36f5e6c3
2022-03-08 16:28:22 +01: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
Mateusz Cicheński
429c0a9769 Merge "Moving the resources related to PiP to the WindowManager/Shell." into tm-dev 2022-02-23 19:49:36 +00:00
Mady Mellor
ba688138fb Merge changes from topic "floating_dismiss" into tm-dev
* changes:
  Update PIP dismiss to use DismissView
  Update dismiss to new spec
2022-02-23 18:12:07 +00:00
Mady Mellor
953a9e14c7 Update dismiss to new spec
1 - larger gradient (same for both phone & tablet)
2 - gradient is now based on theme color

Test: manual - have a bubble, drag to dismiss it, observe the gradient
Bug: 217211205
Change-Id: Ibef23992089f0ae33dd93f9528a3ea2887aae465
2022-02-22 14:16:48 -08:00
Mady Mellor
9294a41db2 Adjustments to expanded view size and position
* Previously on large screens the expanded view was centered on the
  screen now it will be anchored to whichever edge it was expanded on
  ONLY when in landscape on a large large screen. In portrait, and on
  "small tablets" it will continue to be centered.
* Updates the width of the expanded view on portrait and on landscape
  for large screens.
* Adds the notion of small tablet

Test: manual - Open a bubble in various configurations:
      1) on phone:
        * landscape => bubbles show vertically on the side they were
          expanded on and expanded view is centered horizontally
        * portrait => bubbles show on top, expanded view centered
          horizontally
      2) on tablet that isn't small:
        * landscape => bubbles show vertically on the side they were
          expanded on and the expanded view is anchored to that edge
          with some padding
        * portrait => bubbles show vertically on the side they were
          expanded on and expanded view is centered horizontally
      3) on small tablet:
        * portrait & landscape => bubbles show vertically on the side
          they were expanded on and the expanded view is centered
          horizontally and takes up more space %-wise compared to a
          large tablet
Bug: 217211205
Change-Id: I7259e03aab35e0039c9b7bd855c12afe38373ace
2022-02-22 14:04:12 -08:00
Mateusz Cicheński
6990ff032c Moving the resources related to PiP to the WindowManager/Shell.
Test: Test: atest WMShellUnitTests:PipBoundsAlgorithmTest
Bug: 218653892
Change-Id: Ieeff465e04cbd1bfc3ddfc47f38e11eefa9e798d
2022-02-18 19:02:26 +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
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
Ben Lin
5636d17fbe Merge "PiP: Disable enterSplit for now." into sc-v2-dev am: b80e7c46da am: 6c5c7f6fb8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16458641

Change-Id: Iad546b3ae5d1e9363e99caa3661f5f7044d9d415
2022-01-20 23:36:23 +00:00
Ben Lin
eab029ce8d PiP: Disable enterSplit for now.
Bug: 206645013
Test: Enter split button no longer appears
Change-Id: I6237dd1c88f50733ab24e45806c413d5777032e9
2022-01-20 02:15:21 +00:00
Aurimas Liutikas
aec26c4f68 DO NOT MERGE Revert "[3/n] Camera Compat UI: Add a camera compat control."
Revert submission 16468379

Reason for revert: Feature development is moving to T.

Reverted Changes:
Id9b9a8930:[3/n] Camera Compat UI: Add a camera compat contro...
Id6be4a954:Enable a camera app compat control on Large screen...
I083aa6718:[2/n] Camera Compat UI: Add interfaces for client-...

Bug: 206602997

Change-Id: I318b89b87cd3b05a3f3dcd428e3d80fe81465011
2022-01-13 15:16:51 +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
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
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
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
Winson Chung
ca5598dd10 Move dagger modules into shell library for reuse
- Certain system ui implementations which use the shell don't depend on
  SystemUI-core, which means that the dagger modules for providing the
  core Shell components need to be copied (which makes it more cumbersome
  to make changes). Instead, move these modules back into the shell lib
  for any SysUI app to reference.

Bug: 205019015
Test: make SystemUIGoogle
Test: make CarSystemUI
Test: make ArcSystemUI
Change-Id: I8dc938a7695972f9d7b3d7ea8e3ce65a7b454b13
2021-11-05 12:53:14 -07: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
Tony Huang
70b7b1e2d8 Fix divider rounded corner on specific devices
On large rounded corner devices, Rounded corners around divider
cannot display right corner path because it need more space to
draw corners and divider bounds is fixed.

Fix this by enlarging the divider window bounds. However, if we only
enlarge it, it will cause divider touch region too big to make app
hard to interactive. Therefore, migrate touch region setting logic
in legacy split to here, only set divider handle view size as touch
region.

Fix: 202808282
Test: flash on barbet and active split screen to check
Test: pass existing tests
Change-Id: If292c0d4c598d75672ec821d1fee45a8892b236f
2021-10-28 09:01:37 +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