Commit Graph

63 Commits

Author SHA1 Message Date
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
Vinit Nayak
837359b1ea Set correct divider dimension for task menu options
Previously divider drawable dimension was set on height,
which only works when things are divided vertically.
For horizontal layouts, we need to set divider width.

Bug: 192398954
Test: Tested portrait + fake/real landscape
+ tablet

Change-Id: I5a63df9749bf37c3a563e923a1b4724aa17d9409
2021-07-01 02:05:42 +00:00
Vinit Nayak
063cb2d892 TaskMenu in overview UI polish
Bug: 188168717
Test: TaskMenuLooks closer to mocks.
Change-Id: I1560b66a48c4c70c7c79f7307b2b76f22e30c653
2021-05-25 14:42:35 -07:00
Vinit Nayak
2dbdddb4ba Add funtional animation for SplitSelect from Grid.
Long ways to go to final UI - TODO(b/186800707)
Add comments to grid layout code,
no functional changes at all.

Bug: 181705607
Test: Enter split screen from overview task menu
in grid and carousel. Able to select all items
and enter split.

Change-Id: Ib62f1b286acf0781ec47862fa31b670e6ff1892a
2021-05-05 09:38:42 -07:00
Vinit Nayak
4cc0dbb552 Change TaskIconMenu to lay out vertically
Still lays out horizontally when in phone
landscape.
TODO(b/186583656), need to center view.
Also have all layout be dynamic instead of having
some cases be in XML and some in code.

Bug: 181704764
Test: Task menu visible with all options in
portrait/landscape tablet
portrait phone
fake/real landscape phone

Change-Id: I3632eeb174f3e4baf2c9d69d51c1815c3c512e59
2021-04-28 11:47:08 -07:00
Sunny Goyal
c39db7321f New spring overscroll in pagedView
> Using EdgeEffect in PagedView for overscroll
> Keeping RecentsView overscroll similar to S, by created a custom EdgeEffect

Bug: 183966408
Test: Manual
Change-Id: Ia547cf14ea315468b12a4ff5f389ac2d2beceafa
2021-04-22 16:28:30 -07:00
Alex Chau
9594c6987f Handle page offset for grid overview
- Use TaskView's actual position with grid/fullscreen translation considered for taskPosition calculation
- Shift taskPosition by midpoint scroll, and no longer assumes midpoint is on middle of the screen
- Handle situation that TaskView is on left/right of midpoint, making the calculation generic to be able to handle grid situation

Bug: 175939487
Test: Launch modal view with wide/, RTL/non-RTL, orientation/simulated landscape combinations
Change-Id: Idd0cc9c5e24f453d830e1420319a38d3d784270d
2021-04-16 12:25:49 +01:00
Sunny Goyal
c82916fecb Some cleanup in RecentsView
> Merging overview and all-apps scrims into a single View
> Decoupling TaskMenuView from taskView

Bug: 184676497
Test: Manual

Change-Id: I49f7249eaa2a800054385ab8e73a441d6a1b5e16
2021-04-06 15:47:33 -07:00
Vinit Nayak
e3f7d0d1b4 Add split placeholder view above OverviewScrim
Only show single split option for landscape and
seascape overview menu options.

Bug: 181705607
Change-Id: I577fbaed41b5debd007c953851ec2056988057d9
2021-04-05 12:41:06 -07:00
Alex Chau
dedbc8ac36 Remove grid scaling in Overveiw
- Grid scaling has problem that scales task icon and menu, which makes it hard to control icon size and text size in the manula
- Replaced the whole concept with dedicated Task size calculation in grid layout
- Support different icon size in TaskView in grid and removed task_thumbnail_top_margin
- Removed grid progress in TaskViewSimulator as well
- Refactored how ClearAllButton scroll and translations are calcualted to align clear all properly in grid
- Make page center calculation aware of PagedView pivot and scaling

Bug: 174464863
Test: Manual on two screens
Change-Id: I47b13ef6e55c6e16c52ea04225f5bde02ed82fc2
2021-03-24 18:46:32 +00:00
Vinit Nayak
d987a828e8 Initial commit of new split screen work.
TODO:
* Extract out common elements in TaskShortcutFactory.MultiWindowFactory
for commonalities between new and old way of
invoking split screen
* Integrate with WM APIs (b/182002789)
* Write tests for SplitSelectStateController

Bug: 181704764

Change-Id: Ice35adb4ea82897f5e2433dc9b93a549f3d511b5
2021-03-15 15:42:32 -07:00
Alex Chau
b794ea64c7 Show TaskView as grid in large screens
- Introduced gridProgress to RecentsView/TaskView ofr animating into grid
- Introduced gridProgress dependant translation and scale properties in TaskView
- Animate running task into grid with TaskViewSimulator
- Remove overview actions (for now) but keep clear all button in large screens
- Adjust ClearAllButton translation to acoomodate for grid
- Use screen width +-50% to calculate task visibility
- Use the position where TaskView is on screenEnd as pageScroll
- TODO: Handle separate recents activity

Doc: go/foldables-launcher-overview
Video: http://dr/file/d/107Aydii1LoFCwP63nWG3Twr2PBDE5ZgD/view?resourcekey=0-aUjdnx8ezimS9tmAgao9ag
Test: Test Launchering overview and launching overview from apps with folloiwng combination:
- large / small screen sizes
- portrait / landscape
- thumbnails from different screen sizes / orientations
Bug: 174464863
Fixes: 181509346

Change-Id: I4b691cde774f2e37532b68ba83c6eed399f2332e
2021-03-02 17:10:45 +00:00
Tony Wickham
e3386502cf Fix TaskViewTouchController crash in seascape
Previously, we were using scroll direction POSITIVE as a catch all
to mean "up" but in seascape, we actually want NEGATIVE. Added
getUpDirection() to capture that. Tried to clarify the code a bit
by putting all the methods used solely by TaskViewTouchController
together with documentation. It's still pretty confusing and feels
redundant, but couldn't think of an obvious way to simplify.

Test: Swipe up and down on a task in all permutations of:
- 3 button mode
- Gesture navigation
- Portrait
- Landscape
- Seascape
- LTR
- RTL
- Home rotation allowed
- Home rotation disallowed

Fixes: 174009771
Fixes: 173567204
Change-Id: Id0f8d6f4365d888eb46182d8544d18206795dfb8
2020-12-11 17:30:41 -08:00
Tracy Zhou
991e8208cc Quick fix from ag/12914139
Test: N/A
Change-Id: I0b8274f8a912d091cfbbebafdee220b5e46ee74f
2020-10-28 22:34:23 -07:00
Tracy Zhou
55940ecfc7 Render and track live tile position when launching another app from Overview
Fixes: 165394366
Fixes: 170338328
Test: Manual
Change-Id: Idfcd423cbe062af33564eaa9e83ec21fbac0cdf9
2020-10-27 15:45:01 -07:00
Tony Wickham
69f9cae810 Remove CurveProperties#pageParentScale
Test: Set TaskView#EDGE_SCALE_DOWN_FACTOR = 0.2f, then swipe
down on the centermost TaskView; ensure it fills the screen.
Alternatively, touch and hold the nav bar and ensure there is
no jump in scale on the app window.

Fixes: 169259407
Change-Id: Ib3cfba6ebafbcb90de9c6b1ab79f53605d995321
2020-09-23 17:39:07 -07:00
Tony Wickham
70a556da1d Add translation component to swipe up resistance am: ce8b2b5180
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12174363

Change-Id: I18d7be49bb3bfc9f846c14a9138b5daf381e1d56
2020-08-07 20:22:52 +00:00
Tony Wickham
ce8b2b5180 Add translation component to swipe up resistance
Now recents view follows your finger all the way to the top of the
screen. Specifically, your finger tracks the bottom of the window
until resistance starts (when RecentsView is at 75% scale), then
we add translation to compensate for the slower rate of scaling
down, such that your finger slips to the top of the window by the
time it reaches the top of the screen.

Also reset this translation back to 0 in the state handlers.

Bug: 149934536
Fixes: 158701272
Change-Id: Iaee58da758d422f0173c29d002f5c451ce0c1809
2020-08-07 12:32:50 -07:00
TreeHugger Robot
4ade3fd561 Merge "Fix adjacent page offset in landscape orientation" into ub-launcher3-rvc-qpr-dev am: 3f20e33af6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12327711

Change-Id: I8f2da96439372a9f6671469c3c41e4c0a43a4067
2020-08-07 00:10:05 +00:00
Tony Wickham
3b9d5843c9 Fix adjacent page offset in landscape orientation
Before, the adjacent tasks were coming in from the top and bottom
of the screen rather than the sides.

Bug: 149934536
Change-Id: Id6e57dcbc1967d70869df06068d25717de116934
2020-08-06 15:04:51 -07:00
Andy Wickham
17d0080cc3 Adjusts Clear all to be vertically centered with the tasks.
I made a sample task where the content of the app was
centered, and I added lines to demonstrate the center
while in Overview. As you can see, the center of the
app content is slightly different from the TaskView
in Recents - it seems part of the bottom of the app
gets removed when transitioning to Recents (for the
rounded corner radius or nav bar?). On Pixel 4, I
had to add 46dp of padding to the bottom line for it
to appear at the bottom of the screenshot in Recents.

Screenshot: https://drive.google.com/file/d/1xzQNXWb0T0UGDhDS9Ov-AduM3nd-pfg8/view?usp=sharing
Before: https://drive.google.com/file/d/1ghN9VWP44XjcZkdmI106dy4_jB4Vs4J3/view?usp=sharing

Rotating between landscape and portrait:
https://drive.google.com/file/d/1OD5aKT9LCE5w950-6AaHfWXU4sLyW3Qe/view?usp=sharing

Fixes: 154964045
Change-Id: I594057e3b5df58c5a907b6ca14daa700d5011b7b
2020-08-05 19:44:07 -07:00
TreeHugger Robot
d354443535 Merge "Fix adjacent task offset distance" into ub-launcher3-rvc-qpr-dev 2020-07-29 22:26:31 +00:00
Tony Wickham
16eb9226c5 Fix adjacent task offset distance
Instead of calculating an overall distance for tasks to translate
based on RecentsView width, calculate the distance for the tasks
to the left and right of the midpoint based on how far the first
adjacent tasks in those directions are from being offscreen.

Changes made to make "distance to offscreen" calculations possible:
- Update TaskView curve scale to reach final scale as soon as it is
  completely offscreen. Before, it would reach its final scale just
  shy of that point (calculations were off).
- As we update RecentsView scale, calculate how much the new scale
  will push out tasks that are just offscreen.
- With both above, we can calculate the scale and position of a
  TaskView such that it is just offscreen, and interpolate
  between its current position and that position.

Tests:
- Task comes in immediately when quick switching from home, and
  doesn't shift as you swipe directly upwards.
- When swiping far up from an app, tasks come in from all the way
  offscreen, and cover distance appropriately (e.g. if you're
  scrolled a bit to the right when you pause, the left adjacent
  app will move faster to cover the farther distance).
- Task modalness: entering Select mode now animates adjacent tasks
  at the same rate as the scaling up, because they move only the
  distance needed to get offscreen (before they moved way too far
  and thus seemed to be much faster than the rest of the animation).

Bug: 149934536
Change-Id: Ie3fffe0e5c304cb16e7637f058f5ce72cee40aeb
Merged-In: Ie3fffe0e5c304cb16e7637f058f5ce72cee40aeb
2020-07-29 22:17:33 +00:00
Tony Wickham
7383d4e6d2 Fix adjacent task offset distance
Instead of calculating an overall distance for tasks to translate
based on RecentsView width, calculate the distance for the tasks
to the left and right of the midpoint based on how far the first
adjacent tasks in those directions are from being offscreen.

Changes made to make "distance to offscreen" calculations possible:
- Update TaskView curve scale to reach final scale as soon as it is
  completely offscreen. Before, it would reach its final scale just
  shy of that point (calculations were off).
- As we update RecentsView scale, calculate how much the new scale
  will push out tasks that are just offscreen.
- With both above, we can calculate the scale and position of a
  TaskView such that it is just offscreen, and interpolate
  between its current position and that position.

Tests:
- Task comes in immediately when quick switching from home, and
  doesn't shift as you swipe directly upwards.
- When swiping far up from an app, tasks come in from all the way
  offscreen, and cover distance appropriately (e.g. if you're
  scrolled a bit to the right when you pause, the left adjacent
  app will move faster to cover the farther distance).
- Task modalness: entering Select mode now animates adjacent tasks
  at the same rate as the scaling up, because they move only the
  distance needed to get offscreen (before they moved way too far
  and thus seemed to be much faster than the rest of the animation).

Bug: 149934536
Change-Id: Ie3fffe0e5c304cb16e7637f058f5ce72cee40aeb
2020-07-29 20:05:29 +00:00
TreeHugger Robot
4b1d1a0f18 Merge "Prevent showing TaskMenuView if icon isn't present" into ub-launcher3-rvc-qpr-dev 2020-07-17 00:04:41 +00:00