Commit Graph

7207 Commits

Author SHA1 Message Date
TreeHugger Robot be0360c6d8 Merge "Report contentInsets only based on what they will be inside apps" into sc-v2-dev 2021-12-11 01:30:26 +00:00
TreeHugger Robot 953873dd18 Merge "DeviceProfile.overviewRowSpacing should exclude extra top margin on grid tasks" into sc-v2-dev 2021-12-11 01:12:57 +00:00
Tony Wickham c7b8957bbb Report contentInsets only based on what they will be inside apps
This avoids changing them when going from an app to launcher (most obvious when going to overview).

This also allows us to not change insets on apps when opening/closing IME, which reduces potential jumpiness.

Finally, also use this logic for 3P launchers by calling directly from TaskbarDragLayerController instead of TaskbarUIController (which was only overridden by LauncherTaskbarUIController). This fixes some bad issues like sending fullscreen insets when opening a folder from taskbar.

Test: Open Calculator, unstash taskbar, go to overview and ensure no jump as taskbar stashes.
Fixes: 200805319
Change-Id: I4f1cc187398d0051863ff44ea90b7ab9c6aaa8f9
2021-12-10 23:47:18 +00:00
Alex Chau 4c98374d99 DeviceProfile.overviewRowSpacing should exclude extra top margin on grid tasks
Bug: 207350366
Bug: 210158657
Test: manual
Change-Id: I28116407c4267259a75fd39637104cea9db73fe3
2021-12-10 23:29:08 +00:00
Tony Wickham 0e0e1cef09 Merge "Fix taskbar being empty" into sc-v2-dev 2021-12-10 22:11:17 +00:00
Tony Wickham 0606773905 Fix taskbar being empty
We set mIconAlignmentForResumedState in endGestureStateOverride(), but then we call applyState() which might aniamte mIAFRS to a different value. To avoid this, set it after applyState() instead.

Specific repro:
1. Open Calculator
2. Go to Overview
3. Dismiss Calculator
  3a. This calls endGestureStateOverride() because the running tile ends
  3b. Previously, we called mIAFRS.updateValue(1) but then applyState() animated it to 0 because we're still in Overview which is an unstashed state. Now the animation to 0 is before setting explicitly to 1.
4. Go home (this sets mIconAlignmentForLauncherState = 1)
5. Open Calculator again. Previously, mIAFRS was already 0 so animating to 0 was ignored. Now, mIAFRS starts at 1 (which is right since launcher is resumed).

Test: see above
Fixes: 210109500
Change-Id: I13f40908f8636291d63ef4b885ac9d08bbf4d393
2021-12-10 18:20:13 +00:00
Alex Chau 9ef8e2dcee Don't snap to focused task in split select
- In split select there is no overview actions, and focused task's snappign position is not centered, it's weird to snap so avoid it
- Follow-up of ag/16378986

Bug: 208644826
Test: manual
Change-Id: I260b5c6164db562717346396b1830af02d408944
2021-12-10 15:27:17 +00:00
Alex Chau b6ad9dfaf5 Allow snapping to focused task in overview grid
Fix: 208644826
Test: manual
Change-Id: Ia6fb2ae44209042f6d40bf8db5d1f43b3b6a27ee
2021-12-10 12:07:21 +00:00
Alex Chau 42cbdee25c Merge "Add split support for 3P launcher" into sc-v2-dev 2021-12-10 09:55:00 +00:00
Hongwei Wang 293b5bc836 Merge "Do not start auto-pip transition when swiping from split" into sc-v2-dev 2021-12-10 08:25:28 +00:00
Hongwei Wang 8274cb287e Do not start auto-pip transition when swiping from split
Also, pass a PictureInPictureSurfaceTransaction to hide the tasks in
split-screen from Launcher to WM to avoid flicker when any one of the
tasks enters PiP.

Bug: 190855091
Bug: 205894095
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/42RWtayanp2qG0mHSf4Q5
Test: manual, enter PiP from split-screen, see Video
Change-Id: Ia8b6243c0d95c2be8007beeefa2083acc856e404
2021-12-09 20:26:23 -08:00
TreeHugger Robot 5692501806 Merge "Only inset IME by 48dp instead of 60dp when taskbar is present" into sc-v2-dev 2021-12-09 23:48:27 +00:00
Tony Wickham 1a2d581cf0 Only inset IME by 48dp instead of 60dp when taskbar is present
- Update providedInternalImeInsets whenever taskbar height changes, since the insets are subtracted from the taskbar window height. This ensures the IME always has the same bottom inset (48dp) regardless of taskbar's window size
- Also translate nav buttons down to center in the new size when IME is showing

Test: Open IME from home and in apps, both in gesture nav and 3 button mode. Ensure IME bottom inset is always 48dp and nav buttons center within that space
Fixes: 201115344
Change-Id: I5ed25b0ffc08145b2221cc5c960e669cc21b2aa7
2021-12-09 22:17:21 +00:00
Vinit Nayak 2a93bc5b30 Add split support for 3P launcher
* Copied logic mostly from
Base/RecentsViewStateController
* There's one KI crash specific to 3P
(b/209694087)
* Swipe to home animation is TODO, but
then again it also seems incorrect for
full-screen app. 3P has many cosmetic issues
throughout.

Bug: 195607777
Test: Tested w/ Nova launcher with grid
and non-grid, able to invoke split screen with
same animations as 1P launcher

Change-Id: I35a1bc92a51caccac4214289e614000cd47bb503
2021-12-09 12:52:04 -08:00
Jerry Chang 5b2bbe7e20 Merge "Always draw background for task thumbnail" into sc-v2-dev 2021-12-09 02:03:42 +00:00
Jerry Chang 7d20de28e3 Always draw background for task thumbnail
Always draw background for task thumbnail because the task snapshot
might be translucent or partially empty.

For example, when drag-to-dismiss split screen, it will reparent tasks
from dismissing split root to the bottom of display. Task thumbnail of
those tasks might be partially empty because the snapshot was taken in
new bounds inherits from display but with split screen content.

Fix: 200096421
Test: drag to dismiss split, observed task thumbnail no longger been
      cropped.
Change-Id: I5d04daa55a558f79ccf5127080088bd0698d06d8
2021-12-09 01:44:46 +08:00
Tony Wickham b5a051ca0b Merge changes I6cf84ec7,Iea599651,If3238286 into sc-v2-dev
* changes:
  Improve quick switch from home to taskbar
  Cleanup some taskbar/hotseat handoff issues
  Fix taskbar stash misalignment when going from app to overview
2021-12-08 17:42:54 +00:00
Alex Chau 1b0e524d94 Merge "Revert "Align OverviewActionsView for 3 button taskbar"" into sc-v2-dev 2021-12-08 17:39:32 +00:00
TreeHugger Robot d1c9cd2700 Merge "Fix split animation for grid RTL" into sc-v2-dev 2021-12-08 12:06:23 +00: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
Alex Chau 9fa58b2fee Revert "Align OverviewActionsView for 3 button taskbar"
This reverts commit 0bd0733ef4.

Reason for revert: b/209025715
Bug: 189807374

Change-Id: I477bacc318e84c16f124cf776ddd8446959755aa
2021-12-08 11:17:14 +00:00
Vinit Nayak 0f12803061 Fix split animation for grid RTL
Fixes: 202156862
Test: Tested grid + non grid,
RTL + LTR

Change-Id: I303f60efdd9f2f2ea412e31e574d9a3b50fecf30
2021-12-07 22:13:06 -08:00
Vinit Nayak 4e0d4239e4 Merge "Align OverviewActionsView for 3 button taskbar" into sc-v2-dev 2021-12-08 04:02:31 +00:00
Tony Wickham 24675d36b7 Improve quick switch from home to taskbar
- Add LauncherState#isTaskbarAlignedWithHotseat() which defaults to !isTaskbarStashed(), but is always false for quick switch from home
- Replaced FLAG_TRANSITION_STATE_START_STASHED and FLAG_TRANSITION_STATE_COMMITTED_STASHED with FLAG_STATE_TRANSITION_RUNNING and a reference to mLauncherState. STATE_START is equivalent to TRANSITION_RUNNING changing to true, and STATE_COMMITTED is equivalent to TRANSITION_RUNNING changing to false. Then can get details from the state such as whether taskbar is stashed and icon alignment from mLauncherState

Test: quick switch from home, both with taskbar stashed in apps and not
Fixes: 194728611
Bug: 204657916
Change-Id: I6cf84ec73a4036e14cc7268667c6f62100884c27
2021-12-07 13:13:48 -08:00
Vinit Nayak 0bd0733ef4 Align OverviewActionsView for 3 button taskbar
Bug: 189807374
Change-Id: I529dba5d4df3d0c3366c111e70991a36bec4bfc3
2021-12-07 13:07:32 -08:00
Tony Wickham 779879ce3d Merge "Remove LauncherState.TASKBAR visible element" into sc-v2-dev 2021-12-07 20:42:55 +00:00
Alex Chau 992db75dae Use percentage scaling for overview thumbnail size
- Limit overview to screen ratio to be at max 70%
- Tuned row spacing and page spacing
- Added 2 more test activities to testOverviewForTablet to avoid dismissing tasks at end of grid, as more grid tasks are now shown

Bug: 207350366
Test: manual
Change-Id: Id04871464bdb3ef2d6b046977b0ffd9bd51bc230
Merged-In: Id04871464bdb3ef2d6b046977b0ffd9bd51bc230
2021-12-07 14:50:40 +00:00
Tony Wickham 9566290e13 Cleanup some taskbar/hotseat handoff issues
- Clearly distinguish Home <-> App icon alignment (ForResumedState and ForGestureState) from Home <-> Home states (ForLauncherState) by renaming onIconAlignmentRatioChanged() to onIconAlignmentRatioChangedForAppAndHomeTransition (for the former)
- Make sure initial state is properly applied by treating all flags as changed
- onIconAlignmentRatioChangedForStateTransition only runs when launcher is resumed (fixes 208648294)
- Animate taskbar background alpha when going between home and app, separate from icon alignment (bug: 204657916)
- Only copy hotseat's alpha to taskbar when hotseat is originally visible (also bug: 204657916)

Test: Open an app on small screen, open large screen and ensure taskbar stays at the bottom instead of aligning with non-present hotseat (bug: 208648294)
Test: Swipe up and down on home scren, ensure taskbar background never appears and there's no jump between taskbar and hotseat
Change-Id: Iea59965118f2bdbd8ce49279f76fb01fbd61f60b
2021-12-06 17:16:19 -08:00
Tony Wickham 7af54403a3 Remove LauncherState.TASKBAR visible element
It's no longer used, so removing to cleanup code and reduce confusion

Test: no functional change
Fixes: 209512651
Change-Id: Ibd671bde7190df976b5365331731a55a9abdbb35
2021-12-06 15:59:39 -08:00
Tony Wickham f1951ce1f7 Fix taskbar stash misalignment when going from app to overview
Keep taskbar unaligned with hotseat if we're stashing anyway

Test: Swipe up from app with taskbar present to overview, check frame by frame to ensure icons morph directly into the handle instead of above it
Fixes: 208697792
Change-Id: If3238286b3383e75eb71fbd3b97d34bb3b44340b
2021-12-06 15:15:34 -08:00
Tony Wickham 3d206ca917 Merge "Fix taskbar jumping when going home" into sc-v2-dev 2021-12-06 20:15:20 +00:00
Jon Miranda 52ee4ec4aa Merge "Play return to icon animation if user swipes back to All Apps." into sc-v2-dev 2021-12-06 18:17:52 +00:00
Alex Chau 5656154f1a Merge "Add back screenshot button to Launcher3" into sc-v2-dev 2021-12-06 17:37:42 +00:00
Schneider Victor-tulias 6c9dbb8db6 Merge "Update taskbar edu strings for i10n." into sc-v2-dev 2021-12-06 15:30:11 +00:00
Winson Chung a21e47c930 Merge "Fix issue with Shell listeners being unbound if SysUI is restarted" into sc-v2-dev 2021-12-04 04:34:27 +00:00
TreeHugger Robot ad890ac5af Merge "Use getMeasuredWidth instead of getWidth in setSplitIconParams" into sc-v2-dev 2021-12-03 20:23:58 +00:00
TreeHugger Robot 79b56b0659 Merge "Revert "Align OverviewActionsView for 3 button taskbar"" into sc-v2-dev 2021-12-03 18:40:37 +00:00
Alex Chau 4bdf8c1754 Use getMeasuredWidth instead of getWidth in setSplitIconParams
Fix: 208647202
Test: Enter overview with app pairs, rotate and rotate back, check the task icon
Change-Id: I14914258a2508cf3f399312f4c88574b27a5e9fa
2021-12-03 18:28:38 +00:00
TreeHugger Robot dff64072ff Merge "Remove keepWindowOpaque and have the window always fade out." into sc-v2-dev 2021-12-03 18:06:24 +00:00
Alex Chau 149acef8d7 Revert "Align OverviewActionsView for 3 button taskbar"
This reverts commit 6e906f3436.

Reason for revert: b/204891006
Bug: 189807374
Change-Id: I1b3f93d44b1691aa3d2cc90222ac93067a5cf6b4
2021-12-03 15:17:51 +00:00
Alex Chau 1bf0fe1b70 Add back screenshot button to Launcher3
- Also make spacing between buttons always 36dp
- Updated screenshot button image for Launcher3

Fix: 208384949
Test: Start overview in Launcher3WithQuickStep, test screenshot button is working
Change-Id: Ieb60ce134813202c1d14137fff0a131e1f5f8c96
2021-12-03 12:32:29 +00:00
Alex Chau 683b4cd824 Merge "Destroy activity/view references to avoid memory leak" into sc-v2-dev 2021-12-03 12:30:49 +00:00
Alex Chau 402252f4b6 Merge "Align OverviewActionsView for 3 button taskbar" into sc-v2-dev 2021-12-03 12:30:49 +00:00
Winson Chung e4dc13ac72 Fix issue with Shell listeners being unbound if SysUI is restarted
- If SysUI is restarted (ie. during dev or a crash), the components
  registering the shell listeners may not be aware of this, and
  listener callbacks will not be re-registered.  Currently all the
  listeners are managed correctly (bound & later unbound) so we can
  just keep the active listener references to re-register if this
  happens.

Bug: 207142749
Test: Kill SysUI, start some apps and ensure Launcher still shows them
      in recents
Change-Id: I47665180bbff3a12b12686e2ca3063ecd188bb56
2021-12-03 04:38:26 +00:00
Vinit Nayak 573fca80f6 Destroy activity/view references to avoid memory leak
Bug: 204891006
Change-Id: If60ac1716c30ebe68fb6e7457d71f542d3075422
2021-12-02 16:05:52 -08:00
TreeHugger Robot 9c7baac12d Merge "Fix direction of matrix inversion" into sc-v2-dev 2021-12-02 23:52:42 +00:00
TreeHugger Robot 7f54d5cde4 Merge "Add icons for staged split" into sc-v2-dev 2021-12-02 23:00:48 +00:00
Alex Chau b31176c83b Merge "Fix switch access for overview grid" into sc-v2-dev 2021-12-02 22:32:01 +00:00
Vinit Nayak 20cbfa5427 Fix direction of matrix inversion
* "And I would have gotten away with it too
if it wasn't for you meddling [matrices]"

Fixes: 208360236
Change-Id: I1607a19c81830f6a037d2337ee1d9e944096e0ac
2021-12-02 22:08:06 +00:00
Tony Wickham e59a723af3 Fix taskbar jumping when going home
- Set resumed state immediately when finishing recents controller to launcher, otherwise there's a race where we start animating gesture state to 0 before animating resumed state to 1, which causes the jump in the bug

Test: Swipe from app to home 10 times, no jump
Fixes: 203725820
Change-Id: Ie8a1add29902a9961ba4d7861ba5424ab656f1c8
2021-12-02 12:19:32 -08:00