Commit Graph

55 Commits

Author SHA1 Message Date
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
Jerry Chang
7bf62d76e8 Add border to indicate side stage split region
Add a view to draw border of side stage root task.

Bug: 189839391
Test: manual checks side stage border.

Change-Id: Ie0606338d6907f92c80f11c7d86dca6bf525e45d
2021-06-23 01:13:44 +00:00
Mady Mellor
9254393aa5 Bubble dismiss updates
- large colored circle, uses same accent color that launcher
  has for remove / uninstall
- added a shrink animation for the target when the bubble is
  stuck via the magnet
- no longer desaturate the bubble being dismissed but rather add
  a bit of an alpha

Bug: 183657564
Test: manual - get a bubble, drag it around & dismiss it, notice
               the animation
Change-Id: If0d0d86b7389f0fa3314598266cd83ecabdc6a9b
2021-06-03 10:16:36 -07:00
Mady Mellor
bb53cce0db Update sizes for the bubble avatar
* Update sizes of badge & bubble; also simplify some of the sizing
  code, we can do it with just the overall size
* Simplified things, instead of the inner / outer sizes just use
  the overall size

Test: visual - create a bubble and look at the size of the bubble and
               badge
      visual - have some bubbles, change display size, create a new
               bubble & verify that all of the sizes are the same
Bug: 183657577
Change-Id: Ibd8609a8737bb0a57519fa70fba17138bb69b379
2021-05-27 10:32:02 -07:00
Mady Mellor
50bcd6ca2b Update the sizes for bubble expanded view
* 16dp on either side / from edge of screen for the bubble view
* 16dp between bubble row & expanded bubble rect (works out to 5dp
  in code: 16dp - 2dp (badge overhang) - 9dp (pointer height)
* max 8dp between the bubbles in the top row
* manage button has some adjustments - 8dp above & below and is total
  32dp from edge of screen; ensure manage button is centered between
  bottom inset & bottom of expanded view

* fixes a bug where there was extra padding being at top of expanded
  view in landscape mode
* removed an unused layout file & unused dimens

Test: visual - expand a bubble, look at spacing of everything on
               screen; do the same in landscape from left and right
               edges of the screen.
Bug: 187715439
Bug: 183658029
Change-Id: I29e699aaf9b6e7bf75447dac6aa6b00a7b272b8b
2021-05-21 14:00:53 -07:00
Mady Mellor
d3bd6bfbf3 Make sure Manage button updates for display size changes
Bug: 160284881
Test: visual - have a bubble, expand / collapse it, update display
      size, expand the bubble & check that the sizes have increased
      & look correct
Change-Id: If6db9ae1b720f7f37fab31cbb6a67a48bee2e0f8
2021-05-20 17:55:57 -07:00
Mady Mellor
0abd3000eb Merge changes I65f46028,Ie3f67ccd into sc-dev
* changes:
  Make the pointer for bubbles expanded view rounded
  Update the manage button to the new style
2021-05-20 19:54:53 +00:00
Mady Mellor
9ac4fb0e34 Merge "Bubbles styling: Update colors to use new theme things" into sc-dev 2021-05-20 16:32:14 +00:00
Mady Mellor
9f97f89342 Merge "Fix some sizes that weren't changing for font scale / display size`" into sc-dev 2021-05-19 18:18:34 +00:00
Mady Mellor
bba5ed7765 Update bubble user education screens to use proper colors
Bug: 173562716
Test: visual - force user education to show & observe it on the
      stack and manage menu
Change-Id: I6988e2c433f17b69de4aed44c1af3bacb475caf9
2021-05-18 15:51:32 -07:00
Mady Mellor
7376a67ad0 Update the manage button to the new style
Also fixes a bug where the overflow view would still leave space
for the manage button even though we don't show something there.

Bug: 183658858
Test: manual - open a bubble and observe the manage button, should
               be on a dark background with light text regardless
               of light / dark theme.
Change-Id: Ie3f67ccd26ad4d75a3ed21a3dee43e2f74d07022
2021-05-18 10:01:43 -07:00
Mady Mellor
367d8ea45f Bubbles styling: Update colors to use new theme things
- Bubble expanded view arrow is now based on backgroundColorFloating
- Bubble overflow expanded view also uses backgroundColorFloating
- Bubble overflow button uses colorAccentPrimary for the circle
  & a dark accent color for the '+' shape
- Manage menu uses colorSurface, had to rename the file bc sysui
  has a file with same name but different colour which was clobbering
  ours

Test: make a bubble & observe UI in light and dark mode, check
      the arrow in the expanded view, the overflow button & expanded
      state, and tapping on the manage menu
Bug: 183658029
Bug: 183658858
Change-Id: Iab5e5536036a8eaecd1c547e5dcfc9d4e77fe5d4
2021-05-18 10:00:38 -07:00
Mady Mellor
76fa21b5dc Fix some sizes that weren't changing for font scale / display size`
Test: manual - have some bubbles
             - change font & display size
             - add a new bubble
	     => ensure UI elements have changed size & match the size
	        of the new bubble (manage text, overflow empty statei
		text, pointer size, manage menu contents)
Bug: 160284881
Change-Id: I2de45ba0975e2e0295abf8b350b9c2fb11ef73a8
2021-05-18 09:59:29 -07:00
Mady Mellor
23f3d34103 Merge "Restrict the width of bubble expanded view on large screens" into sc-dev 2021-04-30 16:07:54 +00:00
Mady Mellor
8e5f4733ee Restrict the width of bubble expanded view on large screens
* Width is restricted via padding applied to the view when the device
  is considered large screen
* Adjusted animation code so bubbles slide in from edges when showing
  vertically
* Overflow uses max height available when on a large screen
* Fixed a bug where overflow height wasn't being updated correctly
  since it's no longer using an activity
* Fixed a bug where when the view was expanded & you rotated its
  position could be off

Test: manual - expand bubble on large screen from left / right edges
               in landscape & portrait
            => bubbles should be anchored to edge they are opened from
               & positioned vertically along the edge
             - expand bubble on phone in portrait
            => bubbles should be anchored to the top edge &
               horizontally
             - expand bubble on phone in landscape, check overflow
            => bubbles should be anchored to the edge they are opened
               from & positioned vertically along the edge, the
               overflow should have a restricted width
Bug: 175211639

Change-Id: I7c3f3024260a08ebdf4c6e7c7724e51fbc480f61
2021-04-29 15:24:49 -07:00
Mady Mellor
435ab536c2 Fix text color for bubble user education screens
Test: manual - look at user education screens for the bubble stack and
               manage button in light & dark theme and make sure the
               text is as expected
Bug: 183238079
Change-Id: Ia83b2e849f46c3e3eb055ff263a0171f4ad62288
2021-04-29 12:57:07 -07:00
Chris Li
9efcb0bd3f Merge "Allow non-resizable apps in split-screen (12/n)" into sc-dev 2021-02-22 18:32:20 +00:00
TreeHugger Robot
9801436e7f Merge "Fix The education UI above one-handed mode isn't localized and Display size changes" into sc-dev 2021-02-20 12:03:43 +00:00
Jason Chang
bd2e7aa6ae Fix The education UI above one-handed mode isn't localized
and Display size changes

Handling onConfigurationChanged() event to response system
configuraiton changes.

Bug: 177980234
Bug: 177222027
Bug: 177222126

Test: manual
Change-Id: I93dec3e83ae287c5dabc494625929c43f44a7037
2021-02-18 14:38:23 +08:00
Chris Li
de551ad9b6 Allow non-resizable apps in split-screen (12/n)
Before, the hint uses PopupWindow to be placed at the bottom right of the
Display, which can't be attached to Task. Now, render size compat button
 hint popup on Task surface with WindowlessWindowManager.

Fix: 178327644
Bug: 176061101
Test: atest WMShellUnitTests:SizeCompatUILayoutTest
Test: atest WMShellUnitTests:SizeCompatHintPopupTest
Change-Id: I6f8d7afc996d7f312516d85deb2bd113eae8bc3f
2021-02-17 20:57:15 -08:00
Hongwei Wang
1c2fd3aa7f Polish the PipMenuView when showing the controls
- Decreases the menu action size
- Wraps custom actions into PipMenuActionView and restricts the size
  to be identical to other PiP actions such as settings and dismiss
- Removed unused pip_menu_activity.xml layout

Screenshot: https://screenshot.googleplex.com/6LFk5WJFfC4FQyA.png
Bug: 179312210
Test: Enter PiP and tap to show controls, see screenshot
Change-Id: I9de63be60ff66ee5198785885a28d495f1fb7af3
2021-02-16 14:27:46 -08:00
Chris Li
85377a9785 Allow non-resizable apps in split-screen (10/n)
Render size compat restart button on Task surface with
WindowlessWindowManager.

Bug: 176061101
Bug: 178327644
Test: atest WMShellUnitTests:SizeCompatRestartButtonTest
Test: atest WMShellUnitTests:SizeCompatUIControllerTest
Test: atest WMShellUnitTests:SizeCompatUILayoutTest
Change-Id: I86912adca18a6a62265cd31585f2c7d612c90fd1
2021-02-15 14:05:01 -08:00
Hongwei Wang
f3e5e9cdee Merge "Revert "Add an invisible layer to trap focus"" into sc-dev 2021-02-08 22:36:14 +00:00
Hongwei Wang
f2fd0294a9 Revert "Add an invisible layer to trap focus"
This reverts commit cb98114abd.

Reason for revert: Not needed once ag/13507782 is merged

Bug: 169372603
Change-Id: I52d4344f6f2f3fb973f3f20e7d6f1ec2844d7567
Test: manually enter PiP
2021-02-08 18:43:30 +00:00
Hongwei Wang
58b9a4e48e Merge "Add an invisible layer to trap focus" into sc-dev 2021-02-03 01:22:03 +00:00
Chris Li
27d983a098 Allow non-resizable apps in split-screen (8/n)
Refactor SizeCompatModeActivityController to WM Shell. The old one will
be removed in separate cl as there are some dependencies in other
packages.

This cl is mainly for refactor. Major change will come after.
Besides refactor, also changed the mActiveButtons key to TaskId, because
launcher Task will also trigger onTaskInfoChanged, but should not remove
the restart button on the same display.

Bug: 176061101
Bug: 178327644
Test: manually verify that the size compat restart button works as usual
Test: atest WMShellUnitTests:SizeCompatUIControllerTest
Test: atest WmTests:SizeCompatTests
Change-Id: I9143e079a1a945b76c3c56596976dd6ad2802897
2021-02-02 12:54:40 -08:00
Hongwei Wang
cb98114abd Add an invisible layer to trap focus
This is a work around for b/169372603 where PiP menu defaults the focus
on expand button when being attached to system window.

There is another inconsistency observed regarding of touch feedback
which may not be related to b/169372603 but worth mentioning
- when entering PiP and close button is shown, tap on PiP window shows
  visual touch feedback
- when PiP menu in closed state, eg. nothing is shown in menu, tap on
  PiP window shows no visual touch feedback

Video: http://rcll/aaaaaabFQoRHlzixHdtY/cLwTz7ad7P9nrrqk1uPiRP
Bug: 169372603
Test: Enter PiP from YT, see video
Change-Id: Ief8976fac28a65ac35724adcad7f25e11f1876a5
2021-02-01 21:12:49 -08:00
Hongwei Wang
352f35ddaf New tap on PiP window behavior
PiP window stays same on tap if it's large enough to hold all the
actions within it. Ignore the artifacts in demo video such as the shift
of settings button and menu resize out of sync, they are tracked in
separate bugs.

Video: http://rcll/aaaaaabFQoRHlzixHdtY/hkQgdmbuBhNT0WdKW8aegL
Bug: 175055101
Test: See video
Change-Id: Ie19b30dd1e8ba716095b76a3f341b5ab2a51399b
2021-01-28 17:42:53 -08:00
Lucas Dupin
2107c5815f Make bubble scrim respect opacity flag
Test: atest ScrimControllerTes
Fixes: 173562716
Change-Id: If815eb75f63078741f2b1104938b223e0a99df31
2021-01-25 16:27:14 -08:00
Winson Chung
ebf6903682 Move the overflow ui to the bubble window
- An activity always runs on the main looper of the process
  and this simplifies threading since all bubble data will
  run on the shell thread
- The BubbleExpandedView will not initialize the task view
  when mIsOverflow is set.  We still snapshot the overflow
  view to keep the existing selection animation logic the
  same between overflow/task bubbles

Bug: 161979899
Test: atest WMShellUnitTests
Test: atest SytemUITests

Change-Id: If3632a3030c58c9ec334afcb06aac4c51e28938b
2021-01-19 14:39:39 -08:00
Sergey Nikolaienkov
1991120975 Fix and clean up Tv Pip Menu
Fix for Tv Pip Menu not properly setting custom actions provided by an
application.
Fix Pip Menu not closing on the Home button press.
Simply and revise Tv Pip Menu implementation which now consists of 3
classes:
- TvPipMenuController
- TvPipMenuView (formerly PipMenuView)
- TvPipMenuActionButton (formerly PipControlButtonView)
and thus spare
- PipControlsView
- PipControlsViewContoller

Bug: 174818743
Test: atest WMShellFlickerTests:TvPipBasicTest
Test: atest WMShellFlickerTests:TvPipMenuTests
Test: atest WMShellFlickerTests:TvPipNotificationTests
Change-Id: I9e08ca142e0407a4ede084323b0201194a7e89b8
2020-12-28 06:22:41 +00:00
Jerry Chang
2c8ea7b021 Fix showing black background when resizing the divider bar.
Reports resizing state to WM core so that app client could apply bigger
visible bounds while resizing splits. Also moves DividerHandleView to
more generic package.

Fix: 172704238
Test: manul check divider behavior
Test: atest WMShellUnitTests
Change-Id: I1656c86de9a0b5dfe5e6da57ccc9d5f6e467843a
2020-12-17 07:39:24 +08:00
Wale Ogunwale
062b17a171 Rename splitscreen package to legacysplitscreen
Split-screen implementations moving forward would be based on app-pairs
and main/side stage models. So, renaming existing package to avoid
confusion.

Bug: 175416931
Test: They pass!
Change-Id: I55ab1d27fb1c00ba7a58d685ea7eb2840efb9437
2020-12-14 12:13:11 -08:00
Jerry Chang
0c9c2cfac1 Support dragging divider bar of app-pair to resize the splits
Update SplitLayout and DividerView to support dragging divider bar and
make them more generic to be able to share among different split impl.

Bug: 172704238
Test: manual check the behavior of divider bar
Test: atest WMShellUnitTests
Change-Id: I16ed1fd86bdff4d8544c5787c95315c59055ad04
2020-12-04 01:49:58 +08:00
Jerry Chang
0545edfa3d Add divider view support for app-pairs
Add divider bar for app-pairs. AppPairLayout and divide policy records
and handles the layout in pair.

Bug: 172704238
Bug: 172704672
Test: manul check the behavior of the splits and divider bar.
Test: AppPairTests, AppPairsPoolTests, AppPairsControllerTests

Change-Id: I688c7001d056fe8dd9a192885e1f9fd5f004dc11
2020-11-17 11:22:19 +08:00
Mady Mellor
ed1098532d Merge changes I36b9cedc,I79948a4b
* changes:
  Allow Bubble overflow to be opened without other active bubbles
  Flexible bubble sizing & fixed position
2020-11-12 00:26:43 +00:00
Mady Mellor
97fcd7a082 Flexible bubble sizing & fixed position
This will enable some stuff for taskbar & hopefully make customizations by
ARC++ easier??

- BubblePositioner now tracks the size of the bubble & bitmap within it.
  Have to use a multiplier to derive the size of a couple of things now
  (e.g. bitmap size)
- BubblePositioner now tracks the position of the bubble stack & allows
  a way to override / set a fixed position. If something is in fixed
  location, it is not draggable (however when expanded you can still
  drag individual bubbles to dismiss)
- BubblePositioner tracks some taskbar related info
- Rather than checking for "isLandscape" we want "showBubblesVertically"
  (e.g. device might not be landscape but should be vertical if taskbar)
- Fixes an animation issue where bubbles super-overshoot the y position
  when expanding vertically.

Bug: 167413172
Test: a lot of manual testing
Test: atest WMShellTest SystemUITests
Change-Id: I79948a4bd6b58fb3aa2f52e2553f3dfc31630cf1
2020-11-11 12:57:29 -08:00
Sergey Nikolaienkov
50118593eb Add TvPipMenuTests
Bug: 171520419
Test: atest WMShellFlickerTests:TvPipMenuTests
Change-Id: If74cb25f6c1c46704f35d2c8073c0fdb50c8d7eb
2020-11-06 10:56:31 +00:00
Tony Huang
eb01a25c87 Migrate Bubbles to wm-shell (5/n)
Move bubbles package and related resources to shell package,
also copied some used codes and resources.

Bug: 161980186
Test: atest SystemUITests
Test: atest WMShellUnitTests
Change-Id: Ia108bd4149b3c3bf86631ba1a7a6bce0e76af78f
2020-11-04 11:01:56 +08:00
Sergey Nikolaienkov
63a37a3a29 Use PipMediaController in .tv.PipController
Make .tv.PipController rely on PipMediaController for media session
monitoring and managering.
Refactor .tv.PipControlsViewController to use PipMediaController to
retrieve the media buttons.
Make .tv.PipNotification subscribe to PipMediaController to receive
callbacks about media metadata updates.

Bug: 169575409
Bug: 165795012
Test: make WindowManager-Shell; make SystemUI
Change-Id: I397f93eb4433116ba4f476bda7374b07d97e082d
2020-10-28 12:32:33 +00:00
Winson Chung
c932060175 1/ Add basic infra for global drag handling in the Shell
- Add private window flag INTERCEPT_GLOBAL_DRAG_AND_DROP (protected by
  MANAGE_ACTIVITY_STACKS permission) to be considered as a part of the
  normal flow for global drag and drops even if the window is not
  visible.  In addition, the window with the flag receives the clip
  data on DRAG_STARTED and the drag surface on DROP.  If the window
  consumes the drop, then it will relinquish cleanup of the drag surface
  from the system.
- Add MIMETYPE_APPLICATION_ACTIVITY for an app to report that they are
  starting a global drag of an activity. The associated data must
  include an intent with the pending intent and user to launch the
  activity for.
- Add a test drag handler on the shell end to receive the drag, setup a
  drag layout, and just launch the intent (for now).

Bug: 169894807
Test: atest DragDropControllerTest
Test: atest DragDropTest

Change-Id: I7f5cdca3cf515b693a8f1e507e90e22a670b5fa6
Merged-In: I7f5cdca3cf515b693a8f1e507e90e22a670b5fa6
Signed-off-by: Winson Chung <winsonc@google.com>
2020-10-23 20:00:19 +00:00
Bill Lin
2b3bd57805 Move Pip codes from SysUI to WMShell lib (9/N)
Bug: 161118569

Test: make SystemUI
Test: make ArcSystemUI
Test: make WMShellUnitTests
Test: lunch cf_x86_tv-userdebug & make
Test: atest CtsSystemUiTestCases:BasicPipTests
Test: atest CtsSystemUiTestCases:CustomPipActionsTests
Test: atest CtsSystemUiTestCases:FlickerPipTests
Test: atest CtsSystemUiTestCases:PipNotificationTests
Test: atest SystemUITests
Test: atest WMShellUnitTests
Test: manual test PIP demo AP
Test: manual test TV PIP function
Test: manual test disabled PIP
Test: adb shell input keyevent 171(KEYCODE_WINDOW)
Test: adb shell am start -n android.systemui.cts.tv.pip/.PipTestActivity
    -a android.systemui.cts.tv.pip.PipTestActivity.enter_pip
Test: adb root;adb shell am start \
    -n com.android.systemui/com.android.wm.shell.pip.tv.PipMenuActivity
Test: adb shell dumpsys activity service com.android.systemui
Change-Id: I0ec0e9b9bfc4795a10483acd225f14bde9c72407
2020-09-30 08:54:52 +08:00