Commit Graph

31 Commits

Author SHA1 Message Date
Vinit Nayak
b1436b0ae7 Extend recents button hitbox on tablet
* Extends hitbox when recents is tapped
when going from taskbar to overview.
* Extended region lasts for 400ms after
the animation ends.

Fixes: 225885714
Test: Manual, added unit test
Change-Id: I8766279c1a5bf6867f8d69ddd3af2aa3565deec2
2022-05-06 17:04:47 -07:00
Tony Wickham
a681cf6abe Migrate from InsetsInfo.contentInsets to WindowManager.LayoutParams#providedInternalInsets
- This allows us to distinguish taskbar's ITYPE_EXTRA_NAVIGATION_BAR insets from its ITYPE_BOTTOM_TAPPABLE_ELEMENT insets
- Set nav bar insets as before (contentInsets)
- Set tappable elements insets the same, except when taskbar is stashed, in which case set to 0

Test: TaplTestsTaskbar; manually stash/unstash taskbar, open IME, open Calculator (which uses tappableElement() insets) and Contacts (which uses systemBars())
Fixes: 215411414
Change-Id: If00f7a590b0780715d5b8159f5135054364ce84e
2022-04-21 16:15:41 +00:00
Tony Wickham
36c9d888d8 Move taskbar insets logic to TaskbarInsetsController
Test: TaplTestsTaskbar; manually stash/unstash taskbar, open IME
Bug: 215411414
Change-Id: I73622dc020c4f8c8b3d317fcb1dd072bcfc3d274
Merged-In: I73622dc020c4f8c8b3d317fcb1dd072bcfc3d274
2022-04-20 19:27:48 +00:00
Brian Isganitis
a2f26954a0 Set taskbar touchable region to empty when all apps is open.
Fix: 223653710
Test: Manual
Change-Id: Ia78831028b67aa425d5bd5ae61ae460d3caabbb7
2022-03-10 11:21:27 -08:00
Brian Isganitis
1bc23b7662 Ignore touches in taskbar and all apps windows during system drag.
Touches are ignored as soon as we want to start system drag so that system drag can start sooner (i.e. before any AbstractFloatingView animations finish). This approach utilizes ViewTreeObserverWrapper's compute insets listener by temporarily setting the touch region to empty. The taskbar window remains fullscreen until the drag finishes so the touch region is reset at the right point. Similarly, the all apps window is kept open during its drag operations until the drag finishes. System drag state is now exposed through the drag controller to skip predrag.

Test: Manual by dragging to split screen and triggering dismissal
animation from both windows. Verified predrag works.
Fix: 221104066
Fix: 220070070

Change-Id: I424106269c841f58cbe5338d30b6c33fbd889019
2022-03-02 11:31:47 -08:00
Pat Manning
900ef936ad Animate icon dimming in taskbar when force showing in immersive mode.
Test: manual
Bug: 203748818
Change-Id: Iab3c65db502e7dbde3141429e9ae70eec1fabde1
2022-01-27 17:59:35 +00:00
Schneider Victor-tulias
fa0bfee97a Add log dumps for taskbar state
Test: created bugreport and checked logs
Bug: -
Change-Id: Ic0c2330b18c8daf181ae5b236e0c4b212d630fa3
2022-01-20 14:41:25 -08: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
Tony Wickham
821e37b447 Stash taskbar when IME is present, including during gestures
- SysUI removes SYSUI_STATE_IME_SHOWING when starting a gesture from an app, but because unstashing has implications on the gesture transition (e.g. clips the bottom of the app), we defer handling the ime hiding until the gesture settles. Repurposed the flow that swaps the taskbar background during the gesture to support this case as well.
- Delay the unstash when IME is closing, to align with the end of the IME exit transition
- Remove TaskbarViewController.ALPHA_INDEX_IME now that we stash when IME is opening, since stashing already hides the taskbar icons
- Also support passing a starting progress to the stashed handle reveal animation, to allow it to be reversed when cancelled. For example, when returning to an app that has IME showing, we first start unstashing because we're in an app, but then we get the signal that IME is attached so we stash again almost immediately (within a frame or two).

Test: In both 3 button and fully gestural, open a keyboard in an app, ensure taskbar gets out of the way and then reappears at the end when the keyboard is dismissed
Bug: 202511986
Change-Id: I93c298a98ba369ea6310466ff3f802231c582687
2021-11-23 16:37:06 -08:00
Tony Wickham
426b021e22 Merge "Add support for dark tint on taskbar nav buttons" into sc-v2-dev 2021-11-22 22:05:35 +00:00
Tony Wickham
9ceae57095 Add support for dark tint on taskbar nav buttons
Tint the buttons when taskbar isn't drawing a background (either due to alpha or offset).

Test: Dark icons on a light wallpaper on home screen, dark icons when light IME is showing
Bug: 204256643
Change-Id: Iae634a1b604f50edc102905abd0d812a43c5346e
2021-11-17 16:28:21 -08:00
Tony Wickham
bf4a91b0f1 Use TOUCHABLE_INSETS_REGION when IME is visible
This ensures the dismiss button is fully clickable even if taskbar is stashed.

Test: Stash taskbar, can dismiss keyboard by tapping anywhere on the back button
(Same with taskbar unstashed)
Fixes: 206851484

Change-Id: I06f86191e36b596a928c8db8d67a012be033daba
2021-11-17 14:04:25 -08:00
ryanlwlin
1ee6bd7bb6 Fix the cutout of magnification border
If the window is unmagnifiable, it might cause the cutout of
magnification region.
To fix it, we set the flag when the touchable region is not the
entier window frame.

To fix NexusLauncherTests, we add a flag to avoid updateViewLayout
too frequently that would impact memory test and have the performance
issue.

Bug: 196510717
Test: manual test on gestural and 3-button navigation
      presumbit test pass
      run atest NexusLauncherTests with foldables
Change-Id: Ifef81640fe6c08ee1b0dcd3915227fba3002ea43
Merged-In: Ifef81640fe6c08ee1b0dcd3915227fba3002ea43
(cherry picked from commit c8d588cff6)
2021-11-10 09:51:54 +00:00
Alex Chau
c91a43e110 Revert "DO NOT MERGE Fix the cutout of magnification border"
Revert "Do NOT MERGE Fix magnification border includes taskbar"

Revert submission 16003793-magnification_border

Bug: 196510717
Reason for revert: Caused NexusLauncherTests and NexusLauncherOutOfProcTests to stop running
Reverted Changes:
Ibbc9c51ea:Do NOT MERGE Fix magnification border includes tas...
Ida2bb5bf1:DO NOT MERGE Fix the cutout of magnification borde...

Change-Id: I6b2123aedd2a2f23142a34f158d2d9ab71948a18
2021-11-03 14:19:23 +00:00
ryanlwlin
571df892f7 DO NOT MERGE Fix the cutout of magnification border
If the window is unmagnifiable, it might cause the cutout of
magnification region.
To fix it, we set the flag when the touchable region is not the
entier window frame.

Bug: 196510717
Test: manual test on gestural and 3-button navigation
Change-Id: Ida2bb5bf120038ac9153e12790b93bdec195adbc
2021-11-03 10:50:09 +08:00
Tony Wickham
add188f339 Merge "Hide taskbar background when notification shade is expanded" into sc-v2-dev 2021-10-26 02:56:47 +00:00
Tony Wickham
232e9a4631 Hide taskbar background when notification shade is expanded
- In 3 button mode, don't hide the background but do ensure nav buttons are translated down when swiping to notificaitons from the home screen

Test: swipe down notifications, background hides in 0 button mode but not in 3 button mode
Fixes: 199163951
Change-Id: Ic70adc7d67b2ab7c92a2d5d846b9b259d1bd7bfc
2021-10-25 13:44:09 -07:00
Tony Wickham
3f6e3f0650 Stash taskbar in fallback recents
Test: Swipe to Overview with 3P launcher as default, watch taskbar stash
Fixes: 188790554
Change-Id: Id9fdcd715fc50872e3a96f102053a9a99859b482
2021-10-21 10:53:48 -07:00
Tony Wickham
3d0fca7e0d Merge "Don't set Taskbar window to non-fullscreen while folder animates closed" into sc-v2-dev 2021-09-15 17:47:46 +00:00
Tony Wickham
d5e116a750 Don't set Taskbar window to non-fullscreen while folder animates closed
Test: Open an app, open a folder in taskbar, and drag an app from the folder. Ensure the folder close animation plays completely.
Fixes: 199954907
Change-Id: I1caec4ef24b5325724d74f10ddbeae6ef8f9e959
2021-09-14 17:48:14 -07:00
Tony Wickham
cc6a1d6584 Fix taskbar education not touchable if taskbar is stashed
Instead of assuming taskbar window is not touchable while taskbar is stashed, fall through to the areIconsVisible() check, which already returns false if taskbar is stashed anyway. Additionally, add a check for AbstractFloatingView so we appropriately allow touches if one exists.

Test: Open Contacts, can still touch through stashed handle; start TaskbarEduView flow and can touch whether taskbar is stashed or not
Fixes: 199376513
Change-Id: If362bad5cb8262fc8c489010e4b2d306ac5f252a
2021-09-09 09:10:21 -07:00
Tony Wickham
906def495f Fix back button not touchable in SUW
Since NavbarButtonsViewController already checks visibility of buttons before adding them to the touchableRegion, we can remove teh isThreeButton() check.

Test: run adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity, then press back button and ensure it gives visual feedback (even though there's no page to go back to in this test activity).
Bug: 191846922
Change-Id: I10d3d046cd2d14017638a2c71ea6b9fe228fadfc
2021-08-30 09:23:01 -07:00
Tony Wickham
dd7a418335 Draw rounded corners above the taskbar
- Increase height of taskbar window, but not contentInsets
- Draw the inverted corners as part of TaskbarDragLayer#dispatchDraw() (which handles the background already)

Test: visual

Bug: 196257194
Fixes: 197129604
Change-Id: I517949a4c2b97c92e3bb43408776db6deb1379b4
2021-08-23 15:33:43 -07:00
Bryce Lee
a997ca437a Revert "Draw rounded corners above the taskbar"
This reverts commit 157d3b950d.

Reason for revert: b/197129604
Bug: 197129604
Change-Id: Idf2267528fade23291aedea9787d98601495537c
2021-08-18 20:50:58 +00:00
Tony Wickham
157d3b950d Draw rounded corners above the taskbar
- Increase height of taskbar window, but not contentInsets
- Draw the inverted corners as part of TaskbarDragLayer#dispatchDraw() (which handles the background already)

Test: visual

Bug: 196257194
Change-Id: I51d992078579e877c85a1d71ee4c00d85fd9db2e
2021-08-17 15:06:18 -07:00
Tony Wickham
635e180e56 Extend taskbar color to entire screen in overview
Only when taskbar is unstashed in apps:
- Scrim workspace with the taskbar color when opening apps and in BackgroundAppState
- Crop opening apps to above the taskbar
- Crop TaskViews to above the taskbar during gestures

If taskbar is stashed in apps, behavior is the same as before, i.e. no scrim over the wallpaper and no cropping of tasks.

Added a field DeviceProfile#taskbkarPresentInApps to distinguish these cases. LauncherTaskbarUIController and TaskbarStashController ensure this value is set appropriately.

Test: Ensure tasks don't appear behind taskbar when it's unstashed; set ENABLE_SCRIM_FOR_APP_LAUNCH = true to test the whole screen scrimming when opening an app

Bug: 196257194
Fixes: 190681228
Change-Id: I481501457a5a6d49c380feea3db3b4058e4cf3f8
2021-08-16 16:50:52 -07:00
Vinit Nayak
2f4b18bada Hide taskbar on lockscreen
Add new animated float to disable taskbar
background value when keyguard is visible.

Fixes: 191857724
Test: Tested w/ and w/o bouncer for gesture + 3 button
Tested w/ IME pw on lock screen.

Change-Id: I2e1696fd25f4c170bfb2bc0694ccd644e453b1fe
2021-07-22 13:14:51 -07:00
Tony Wickham
3fd22847ac Initial commit of taskbar stashing
- Added StashedHandleViewController to provide properties such as ViewOutlineProvider to animate the handle that's shown in place of taskbar while it's stashed
- Added TaskbarStashController to coordinate the stashed state, including orchestrating the animation across taskbar controllers
- Added TaskbarStashInput consumer to detect long press in the nav region when taskbar is stashed

Behavior:
- Long pressing taskbar background animates to the stashed state by morphing the TaskbarView into the stashed handle view and offsetting the background offscreen
- We persist the stashed state across app launches and reboot; to unstash, long press the stashed handle
- We also visually unstash when going back home

Test: long press tasbkar background when in an app to stash it, long press the resulting stashed handle to unstash; while stashed, swipe up to home to also unstash until launching another app
Bug: 189503603
Change-Id: I698eff785388dff1ef717c76879719d6af236c2d
2021-06-18 17:51:39 -07:00
Vinit Nayak
58ffbef8f0 Enable 3 button nav for taskbar
Bug: 180046394
Test: Switched between gesture and button nav on
phone and tablet.

Change-Id: Iac2357a3256f8b6b36ca49d3680594a91e824a5f
2021-06-16 13:26:21 -07:00
Vinit Nayak
113377d8b8 Tap on recents button twice to go to last app
Fixes: 190660016
Test: Tapped on recents twice and saw last app.
Tapped on recents and tried to tap on other app
icons and none of them launched.

Change-Id: Ie89f1ec0464f194087dc07ab99deb8223ab6ddb8
2021-06-15 15:12:17 -07:00
Tony Wickham
36696d62b0 Reorganize taskbar controllers
Organize existing properties as follows:
- TaskbarViewController contains properties affecting TaskbarView (though child icons are still supplied by TaskbarHotseatController)
- TaskbarDragLayerController contains properties related to TaskbarDragLayer itself
- Renamed NavbarButtonUiController to NavbarButtonsViewController, following the pattern of TaskbarViewController and TaskbarDragLayerController
- TaskbarControllers contains the different controllers to make it easier to construct, initialize, destroy, and pass them around
- Removed TaskbarIconController as its responsibilities were moved to more specific controllers

Test: compiles and runs, manually tested
Bug: 187353581
Change-Id: Idccd95d47117101bf9617e5532a5b87635d2b8f6
2021-06-09 13:27:02 -07:00