Commit Graph

456 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
Bill Yi
d613faacdf Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I8b28d126ae0c5d4e48ea428cf1334f37af282994
2022-04-09 05:33:11 +00: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
b2a5b198cd Merge "Handle PiP shadow radius in WMShell" into tm-dev 2022-03-30 22:23:51 +00:00
Sebastián Franco
97a605b1d1 Merge "Brighten theme-icons when in Dark mode and add dark color for taskbar" into tm-dev 2022-03-29 00:00:33 +00: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
3c5b9738c7 Merge "Implement custom PiP close action on TV." into tm-dev 2022-03-21 07:56:37 +00:00
TreeHugger Robot
6df18cf891 Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-dev 2022-03-19 00:35:33 +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
Bill Yi
dd0d4e2f6f Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I7bd4416c12f23d3c12cd73acb1c51ebec27ea5c6
2022-03-16 14:28:22 +00:00
Bill Yi
8d195c3d85 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I1bc341bcbd5809a117b0e929630ccd52d0a27a56
2022-03-16 14:24:07 +00:00
Winson Chung
8e53c05243 Merge "Fix issue with wrong style being used in landscape" into tm-dev 2022-03-11 05:45:09 +00:00
Winson Chung
edb03dc840 Fix issue with wrong style being used in landscape
- Legacy style was overriding the Shell landscape style for the
  divider

Bug: 213379024
Test: Build sysui from studio and verify the divider background
      is correct
Change-Id: Ic47b411fad0469c86459cc01189a722dbad8d8c3
2022-03-10 18:28:35 +00:00
Robert Horvath
3f574e253e Merge "Move TV PiP away from keep clear areas" into tm-dev 2022-03-09 09:14:54 +00:00
Galia Peycheva
01c7c259fe Merge "Add string for tv pip edu text" into tm-dev 2022-03-08 21:50:21 +00:00
Robert Horvath
c4f571a27e Move TV PiP away from keep clear areas
The PiP is placed in a way to avoid keep clear areas.
If no areas overlapping the default PiP anchor position are defined,
the PiP will stay at its anchor position.
Otherwise, it will try to move to a free location closest to its anchor
position. Unrestricted areas can cause the PiP to move across the entire
screen, but restricted areas have limited influence and can only move
the PiP a short distance.
If no free position is found, the PiP will be stashed for some time.
To find the position to move to once the PiP unstashes, a relaxed search
is performed, excluding a restricted keep clear area. If this still does
not yield a position to move to, only unrestricted areas will be taken
into account. The PiP is stashed along the edge closest to the unstash
position.

Bug: 218416347
Bug: 218494300
Test: atest TvPipKeepClearAlgorithmTest
Change-Id: I76c6527320fc403bb604b188f38eed505eeaab89
2022-03-08 18:23:16 +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
Tom Natan
81e377699b Merge "[17/n] Letterbox Education: change the ripple color of the dismiss button." into tm-dev 2022-03-08 10:24:48 +00:00
tomnatan
ecba16d6fd [17/n] Letterbox Education: change the ripple color of the dismiss button.
Bug: 215314668
Test: N/A
Change-Id: Ifa36569c6bd089868a27448d483121163f41c567
2022-03-07 19:36:24 +00:00
TreeHugger Robot
c44fdb988e Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-dev 2022-03-03 08:56:12 +00:00
TreeHugger Robot
4415e6e1e3 Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-dev 2022-03-03 08:49:58 +00:00
Bill Yi
a647fc0103 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I04abfaab53822bf0ca1139df5d447fce38633667
2022-03-03 06:03:26 +00:00
Bill Yi
a80600e063 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I21b331e61b40654187a6d31e837868154c1a4184
2022-03-03 05:55:45 +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
Sebastian Franco
5abea4f484 Brighten theme-icons when in Dark mode and add dark color for taskbar
Bug: 217247494
Test: change between dark and light mode and transition in and out of apps
Change-Id: I4487b85f68e7ca77508a8648f6397a6f67314b91
2022-02-24 19:01:49 +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
7c4896c5c7 Merge "Implement expanded PiP on TV." 2022-02-14 12:09:21 +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
Bill Yi
3adc794c2c Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I4cceea426257471620d52a2806e22b0c331e2294
2022-02-12 01:18:47 +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
Tom Natan
32d5e048f2 Merge "[5/n] Letterbox Education: update the dialog layout." 2022-02-08 20:32:39 +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
Bill Yi
05e8640ad2 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I663deb83b5032416072a3d922475c5c87e387bdf
2022-02-05 18:43:42 +00:00
Tom Natan
16e0b72647 Merge "Letterbox Education: Cleanup the toast layout." 2022-02-03 10:15:17 +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
TreeHugger Robot
b0c937196d Merge "Import translations. DO NOT MERGE ANYWHERE" 2022-01-28 06:43:01 +00:00