Commit Graph

87 Commits

Author SHA1 Message Date
Alex Chau
8aa3f00238 Land ENABLE_TASKBAR_IN_OVERVIEW
Fix: 270393449
Test: manual
Change-Id: I731bfa8ee86154fd034781e27272abc81a6fe6c6
2023-02-28 20:18:32 +00:00
Vinit Nayak
5a6863f14a Unify split options into single option
* No more split left/right/top, only have
splitscreen and icon shows vertical or horizontal
split windows
* Replace existing split icon for FreeForm

Fixes: 264930810
Test: Tested landscape and portrait, workspace,
overview, allapps

Change-Id: I443f93b6b01760b726bf9f024fb1324fdf0ed03c
2023-02-01 17:27:57 -08:00
Jeremy Sim
8e8352e27e Fix juttering problem with split staging animation
This patch makes it so that app icons no longer jutter uncomfortably when staging and confirming a split from home.

The problem occurred because I used Math.round when calculating the position at which to center the app icon within the SplitPlaceholderView. When an inexact integer is used to calculate the x and y position on every frame, it creates juttering, especially when numerical values are small.

Solved by removing Math.round and using floats going forward.

Fixes: 262308025
Test: Manual
Change-Id: If91d1d3ee52652c155ed7e4e1d4f4620fdc41cc9
2022-12-12 18:18:20 -08:00
Vinit Nayak
b9b7c38d55 Merge "Improve TaskMenuView layouts for split pairs" into tm-qpr-dev 2022-10-21 00:07:53 +00:00
Jeremy Sim
8edca84cd5 Merge "Prevent doubling up on split placeholder insets" into tm-qpr-dev 2022-10-20 20:59:49 +00:00
Vinit Nayak
0f6526e0c4 Improve TaskMenuView layouts for split pairs
* Instead of basing calculations on the TaskView view,
use the TaskThumbnailView as the anchor.
This helps us prevent having to re-calculate positions
that were already done to layout the thumbnails
* TODO: Gracefully handle re-positioning task menu view
on rotation

Bug: 249693334
Test: Manual, opening task menu view in
land/seascape in portrait, w/ and w/o home rotation

Change-Id: I02da96d2735657d5340e23056de69392ff8452c4
2022-10-13 14:15:14 -07:00
Jeremy Sim
0ac4708396 Prevent doubling up on split placeholder insets
This patch makes it so that the split placeholder uses only one inset for buffering the top of the icon: either the default split placeholder inset, or the device's built-in screen inset.

Currently, when we determine the size of the split placeholder, we add the placeholder's default inset to the device's built-in screen inset (camera cutouts, etc.). On some devices, this causes a very large combined inset, and it doesn't leave enough room for all the other UI elements, especially when 3-button mode is active. This patch cuts out one of the insets by selecting only one of the insets to respect (the larger one).

Fixes: 241164191
Test: Manual, checked all emulated inset types on a variety of screen sizes
Change-Id: Ica0e791bf4b8b757ad3fb87ab1cf3105b97a61dc
2022-10-11 21:26:43 -07:00
Vinit Nayak
8f54d597bf Round split layout values instead of using int cast
* Silly us, we forgot that int casting always floors.
Math.round() does a mathematical round.

Fixes: 248575056
Test: Wallpaper no longer bleeds through on split
animation.

Change-Id: I068c030ce6b86fc12faee7778c0d87a0d5aea487
2022-10-07 14:46:25 -07:00
Jeremy Sim
21a5b12b6f Update animations for TM-QPR: Overview > OverviewSplitSelect transition
This change updates the Overview > OverviewSplitSelect animation to the latest spec. This is a re-upload of a previous change, ag/19464657, but no longer will cause the b/241165022 issue.

Includes:
- New timings
- Task thumbnails slide in with an "overshoot" animation
- Icons fade out and fade in appropriately
- SplitInstructionsView has a new compound "unfold" animation

Bug: 236760307
Test: Manual on tablet. Made sure the b/241165022 issue is fixed.
Change-Id: Ia22f6b6d7b9474b782e693fae2320a34a2985b18
2022-09-14 18:06:05 -07:00
Vinit Nayak
2e4dcb16a7 Place TaskMenuView aligned with secondary split thumbnail
* Use consistent divider calculations in
different methods

Fixes: 245610772
Fixes: 218784487

Test: Open task menu view in split pair in landscape/
seascape/portrait, real and fake.

Change-Id: If1bbc7a0d4f1767584d0fc8cf549130f35b8e4a3
2022-09-09 11:25:08 -07:00
Jeremy Sim
2fe7dd7306 Revert "Update animations for TM-QPR: Overview > OverviewSplitSelect transition"
This reverts commit a50bb39048.

Reason for revert: Causes a P1 bug (b/241165022).

Fixes: 241165022
Bug: 236760307
Change-Id: Icc080d9a37e26d70d0f4cf846a4fd39df3b71625
2022-08-18 21:28:54 +00:00
Jeremy Sim
a50bb39048 Update animations for TM-QPR: Overview > OverviewSplitSelect transition
The animation from Overview to OverviewSplitSelect is now updated to the latest spec. See bug for details.
- New timings
- Task thumbnails slide in with a new spring animation
- Icons fade out and fade in appropriately
- SplitInstructionsView has a new compound "unfold" animation

Bug: 236760307
Test: Manual on tablet and phone. Looks good on both true and fake orientations.
Change-Id: If98d4464aa51c876d79bee9672279992a2cf9026
2022-08-14 10:34:51 -07:00
Jeremy Sim
b7a781b599 Merge "Update animations for TM-QPR: OverviewSplitSelect > Home transition" into tm-qpr-dev 2022-07-29 18:57:00 +00:00
Jeremy Sim
1cfe6d490a Update calculation method for Overview UI placement on tablets
This update slightly changes the calculation method for Overview UI placement, in order to line up better with spec. (The previous calculation caused a small 30dp divergence on tablets.)

Bug: 236760307
Test: Manual by measuring pixels and comparing to spec
Change-Id: I94e9e7b5a6a24c37693425ac8ec71cd066003658
2022-07-28 14:05:24 -07:00
Jeremy Sim
e5ba8fa7a5 Update animations for TM-QPR: OverviewSplitSelect > Home transition
The animation from OverviewSplitSelect to Home is now updated to the latest spec. See bug for details.
- New timings
- FloatingTaskView now translates out, instead of fading
- FloatingTaskView and SplitInstructionsView now disappear concurrently with the rest of Overview, instead of afterward

Fixes: 236761067
Test: Manual on tablet and phone
Change-Id: Iaa1c804a60859232f331950098b67968cc187e82
2022-07-21 20:46:43 -07:00
Jeremy Sim
96c2aad623 Prevents split thumbnails from flipping when entering Overview in fake seascape
Fixes a bug where the user would see the splitscreen thumbnails swap position when entering Overview from fake seascape.

The bug arose because Overview's layout in fake seascape previously respected the primary-top secondary-bottom rule for placing splitscreen thumbnails. Actually, this needs to be flipped to preserve left-right orientation: If the user sees Task A on the left, it should always be on the left no matter how they rotate their device.

Fixed by swapping thumbnail and icon positions in SeascapePagedViewHandler#setSplitTaskSwipeRect() and setSplitIconParams(). Fake seascape will now show primary thumbnail on the "bottom" of the screen and secondary on "top."

This patch also corrects a minor calculation bug affecting icon alignment.

Fixes: 221133532
Test: Manual
Change-Id: Id587cf3815e64792d758d0e352da1e1e38cb4348
2022-06-27 22:33:30 +00:00
Vinit Nayak
5424fca602 Rename split classes/variables for consistency
* Use "select" when in the split screen
invocation process
* Drop usage of "staged" except when defining
constants

Fixes: 233006032
Change-Id: I809f0e1e9742aa6b6b09ad8731896ad3f0c9deb0
2022-06-06 14:02:15 -07:00
Vinit Nayak
1eb79473aa Merge "Limit starting bounds of swipe to animation start rect" into tm-dev am: e8a4e0e2dc am: e9e0800fd7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18607508

Change-Id: I7b4afd0d4eae8853e15c06c8f7f6472ef5035bf0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 03:29:15 +00:00
Vinit Nayak
f7b4e7f497 Limit starting bounds of swipe to animation start rect
* If the starting point is greater than that of the current
device's width (in either positive or negative direction),
reset the starting rect to be fullscreen task bounds
* More details at b/228829958#comment12

Fixes: 228829958
Test: Reboot device and swipe up from home immediately,
app doesn't fling from the side.
Tested with portrait and landscape launcher.
Tested with fake landscape launcher.

Change-Id: I6ea24e30e9de5716b7830f487b2ed63f56598c50
2022-05-26 14:43:26 -07:00
Jeremy Sim
b0cce86385 Implement non-disappearing View for split staging instructions
The instructions for how to perform a splitscreen operation, previously conveyed through a disappearing Toast, are now conveyed through a custom View object.

Fixes: 219987907
Test: Manual
Change-Id: Iff2bb6e334e0325e8a091d76a5f9b8767071365f
2022-05-23 21:23:22 +00:00
Jeremy Sim
5d2a1f47c0 Merge "Fix placement bug with split staging icon in RtL" into tm-dev 2022-04-10 01:48:53 +00:00
Jeremy Sim
43c79704ed Fix placement bug with split staging icon in RtL
Fixes a bug where switching the phone to RtL caused Overview's split staging icon to be placed incorrectly.

The bug was caused by the fact that FrameLayout margins were not working consistently in RtL. This may be another bug; more investigation required (b/201920967).

This fix makes it so that the icon is positioned using setX and setY rather than margins.

Fixes: 227372971
Test: Manual
Change-Id: I6e5371d20e8e2e4e6f41ba93d0dfa36ed085c103
2022-04-08 18:05:05 -07:00
Vinit Nayak
1322fc3710 Fix translation for secondary split thumbnail in RTL
Fix: 225157531
Test: Swipe up in RTL shows both thumbnails
were expected.

Change-Id: I87d286b6ce6542c7cffadf86e3d4d99a3618f984
2022-03-30 10:32:51 -07:00
Jeremy Sim
b8eeb41ee0 Fix issue with camera overlapping split staging UI
Fixes an issue on some devices where initiating a split in Overview would cause an icon to be placed partly under the camera cutout.

Fixed by adding some padding to FloatingTaskView#mSplitPlaceHolderView, so that it always respects the device's insets.

Fixes: 220997064
Test: Manual
Change-Id: I7270bde3320f562519ea8e36a38e49609e0d6cd7
2022-03-25 16:31:46 -07:00
Tracy Zhou
8d06bb8991 Merge "Update initial staged split UX." into tm-dev 2022-03-22 22:44:33 +00:00
Tracy Zhou
4ff3615b23 Update initial staged split UX.
- Introduce inset to the staged split view
- Update width of the staged split view
- Introduce rounded corners to staged split view. It's tricky to animate it in with smooth transition considering the rounded corners. The best way to handle it is to draw content as if part of it is off the screen, so that when it's animated in, the rounded corners can slide in onto the screen correctly.

Fixes: 219085340
Test: https://recall.googleplex.com/projects/f46cfe9c-8076-4efe-bf8a-b1cc4f1f5e1b/sessions/09a99b75-3614-4d20-b6d4-a78108f769d8

Change-Id: I24d90cc9e2695d822cb2de8b21e2d5519f2e344d
2022-03-21 21:21:42 -07:00
Jeremy Sim
c0422b8a48 Merge "Fix issue with split thumbnails overflowing during rotation" into tm-dev 2022-03-22 00:17:43 +00:00
Jeremy Sim
bf6f171f84 Fix issue with split thumbnails overflowing during rotation
Fixes a set of issues in Overview where you could cause split thumbnails to overflow their contents into each other by rotating the phone in certain ways.

The issue occurred because StagedSplitBounds objects have their height and width assigned differently depending on if they were created while the phone was in portrait or landscape.

Fixed by adding a conditional check in PortraitPagedViewHandler#setSplitTaskSwipeRect and LandscapePagedViewHandler#setSplitTaskSwipeRect.

Fixes: 218784856
Fixes: 218779313

Test: Manual on local devices
Change-Id: I04b4f4344250da34616ab1744af22fa41b9aba9b
(cherry picked from commit 1d6b7f2abf)
2022-03-19 00:10:54 +00:00
Jeremy Sim
b42345273c Fix paired icon placement in landscape/seascape
In grouped task view, paired icons will now align better with task thumbnails.

Fixes: 218783211

Test: Extensive manual testing on local device(s).
Change-Id: I372d2ee90302a8d96ace048ff4f82126d9b2b363
(cherry picked from commit d6826c74a4)
2022-03-19 00:10:16 +00:00
Sunny Goyal
d4c4ad9212 Removing some unnecessary layout calls in TaskView
Bug: 221095750
Test: Presubmit
Change-Id: I277c1350109ce3bd0b29502c588482c737ab1e3d
2022-02-23 13:06:46 -08:00
Jeremy Sim
c78ac6277c Fix DWB placement in grouped task view
In grouped task view, DWB banners will now rotate properly when phone is
in landscape or seascape orientation. Also fixes a couple of minor
existing issues with the bottom task not displaying correctly in the
first place.

Fixes: 208357326
Fixes: 216218406

Test: Tested locally on Pixel 6, using landscape, seascape, and
portrait. Double-checked with task proportions changed, RtL/LtR, and
split top/split left/split right initialization.

Change-Id: I945f9937d2d4d784c0c74a006c7d0680daf628c2
2022-02-11 00:13:13 +00:00
Jeremy Sim
66a265c87c Center paired app icons
In splitscreen overview, the pair of app icons is now always centered at
the top of the view, rather than following the divider's position.

Test: Visually tested on local P6 device

Fixes: 208648221

Change-Id: I460d06047693c9376dab8215085d54aa4164d69f
2022-01-18 23:03:17 +00:00
Vinit Nayak
ebf2cdd0f1 Show Digital Wellbeing Banners for split tasks
Fixes: 199936292
Change-Id: I38743d58f53a65ef717b1babc21ad1df2dc840a4
2021-12-15 22:19:02 -08:00
Alex Chau
86ef5e924a Handle split select rotation
- Update floatingTaskView, apply splitsSelectTranslation and splitPrimaryScorllOffest when rotating while in split select
- Moved getSplitSelectTranslation to RecentsView
- When in portrait, treat STAGE_POSITION_BOTTOM_OR_RIGHT as STAGE_POSITION_TOP_OR_LEFT in split translation calculation
- Apply splitsSelectTranslation for portrait grid too

Fix: 201721153
Test: manual
Change-Id: I768a3b15de4d434674058b274c368798f5852917
2021-12-08 11:35:02 +00:00
Vinit Nayak
455197bf41 Add icons for staged split
Fixes: 208649953
Change-Id: I8b7bb3a650e836608ebe6aa50631026f5f6a7c63
2021-12-01 14:58:53 -08:00
Alex Chau
9a5f99bfe6 Resets taskSplitTranslation of inactive orientation
Fix: 204185003
Test: manual

Change-Id: I10e49994e8a9723f39d7f9159de7c1f8216ea77f
2021-11-26 12:04:47 +00:00
Alex Chau
6499e83c57 Consider launching task's position on screen in pivot calculation
- Instead of using RecentsViewScroll, put task's position offset versus current scroll as TaskRect calculation, so it's considered when calculating for putting task to full screen
- Revert back RecentsViewScroll to apply before RecentsViewScale
- Added new property in PagedOrientationHandler to apply both primary/secondary param without clearing the other, and renamed an existing method

Fix: 206972618
Test: Quick switching
Test: Launch task from grid, launch side task from carousel overview
Change-Id: I5977975ed1e930ad70b81d83513d8f3a00c0aed4
2021-11-19 14:42:20 +00:00
Vinit Nayak
be7ce023de Use split thumbnail width/height directly
* When swiping to QS from home, the
bounds for the rect on screen are incorrect
because it's technically off-screen when
it's being queried

Fixes: 206155441
Change-Id: Ibb17f2ac291f867b6de06041c980e434ce92cf27
2021-11-17 19:05:29 -08:00
Vinit Nayak
4d57e7091f Shows AppPairs in previous tasks
Fixes: 203006080
Change-Id: I63912a61e7617ec41f229c19cc267dc5a1857bae
2021-11-09 13:47:18 -08:00
Tony Wickham
2fb815b2fd Cleanup split screen offset in TaskViewSimulator
- Removed mRunningTargetWindowPosition and mSplitOffset, as they countered each other out anyway
- Removed PagedOrientationHandler#setLeashSplitOffset() since it's no longer used

Test: Swipe up from split and non split apps in both orientations on large and small devices, with and without home rotation enabled
Bug: 200817624
Change-Id: I78a80cbc718ee38a8933fa323798fb436710d59f
2021-09-24 15:37:30 -07:00
Vinit Nayak
9e6a642d8b Shorten and center TaskMenuView for landscape
* The width of the task menu view for landscape
(both fake and real) is the same as the width
it would be in portrait.
* With the shorter width, we also center the
positioning of the TaskMenuView
* Note this is only for phone, large screen
changes TODO

Bug: 193432925
Test: Tested real/fake landscape + seascape,
view is centered. Portrait same as before.

Change-Id: Ide41e252a3c177c4a911aab544f78930fed2e76f
2021-09-22 14:55:29 -07:00
Vinit Nayak
af6b85e3bc Show multiple icons for GroupedTaskView
* Hide all overview actions for GroupedTaskView
* Move some logic from TaskView into respective
PagedOrientationHandlers
* Remove unused methods from PagedOrientationHandler
* NOTE this is just visual changes. Properly showing
task menu's is still in-progress

Bug: 181704764
Test: Tested GroupedTaskView in portrait/landscape,
fake landscape in small screen, and real portrait/landscape
in large screen

Change-Id: I9c13ca114024db0a8e3fa5d295951696adb8516f
2021-09-17 10:16:56 -07:00
Vinit Nayak
e6abfca7ab Set GroupedTaskView child thumbnails in onMeasure
* Also add indicator if split was originally started
in portrait of landscape, so we know which dimension
of the divider bar to use if user goes to overview
and then rotates device (horizontal divider vs
vertical)

Fixes: 199461137
Test: Swipe to overview with staged split
Rotate device with and without live tile
Doesn't overlap with overview actions

Change-Id: I8b7f104f16d5b7265828f1b3d98ba3426b28d44f
2021-09-13 18:07:09 -07:00
Vinit Nayak
d1a70eeb75 Slight polish for split screen gesture animation
* Divider bar dimensions manually calculated since
the leash that is provided has bounds larger than
the space that is visually shown between the two split
apps

Bug: 181704764
Test: Swipe up on large and normal screen,
w/ and w/o home rotation enabled

Change-Id: I1fde053151d47c6ce3e11f16f8ae4a153d273871
2021-09-08 17:39:49 -07:00
Vinit Nayak
cdcaf7a2ed Code cleanup from rebase
Bug: 195423591
Change-Id: I623d6ef46458a282e3c63cde0bdc457cb38e4d50
2021-08-27 16:28:12 -07:00
Vinit Nayak
6174106f68 Add Split button in OverviewActions
Shows up only for large screen devices, not phones.
Tested for NexusLauncher, general 3P launcher support
needed for staged split (TODO b/195607777)

Bug: 195423591
Change-Id: I4d455769b17637174b590c640516b9fbb6352c3d
2021-08-26 11:49:38 -07:00
Vinit Nayak
aa11976cc5 Fix public variables to not have 'm' prefix
Bug: 181704764
Change-Id: I89e43ce6cc74119514c8124e7cc61b11dc475f58
2021-08-25 11:59:43 -07:00
Vinit Nayak
c35507dc29 Set thumbnails for GroupedTaskView based on split layout bounds
Bug: 181704764
Test: Go to stage split in landscape w/
home rotation on/off, swipe up.
Thumbnails aren't perfectly overlaid, polish needed

Change-Id: I54e39cc5a18f527e80a664d60aca72dfd706ebdc
2021-08-25 11:59:00 -07:00
Vinit Nayak
8b78c138d4 Implement swipe gesture for staged split in landscape
* Maintain task split percentages when swiping up.
* Split percentages not maintained in GroupedTaskView, however.
That is a TODO.

Bug: 181704764, 181705607
Test: Swiped up in landscape with home rotation on/off.
Portrait still works.

Change-Id: Iec62abae34f6ccadf98e2afdc9409cf3160f8223
2021-08-24 17:32:47 -07:00
Vinit Nayak
7903758d08 Animate SplitPlaceholderView when entering split from overview
Bugs tracked in b/181704764

Bug: 181704764
Test: Tested on phone and large screen in multiple orientations

Change-Id: I07509006ae3d1f4425dc5119d0c8ed52b41a3bc2
2021-07-22 20:12:26 +00:00