Commit Graph

158 Commits

Author SHA1 Message Date
Johannes Gallmann 200ee94279 Don't cancel or commit predictive back on multi touch in 3-button-nav
Bug: 381054861
Test: Manual, i.e. verify that tapping the taskbar while predictive back is in progress does not cancel or commit it
Flag: com.android.window.flags.predictive_back_three_button_nav
Change-Id: I4117aca74216849519a0cabcbd3cb14f7fc5b38f
2024-12-10 13:28:36 +00:00
Treehugger Robot d7b3369036 Merge "Ignore events that occur between app icons on the taskbar" into main 2024-11-27 20:22:17 +00:00
Johannes Gallmann b28ff34177 Cancel predictive back when sliding off back button
Bug: 373544911
Test: Manual, i.e. verified that sliding away from the back button (within the taskbar window) cancels the predictive back animation
Flag: com.android.window.flags.predictive_back_three_button_nav
Change-Id: I9a1448c7005211c87a8979261b13fe37ab64a5b2
2024-11-22 13:09:56 +00:00
Artsiom Mitrokhin 7205b24938 Ignore events that occur between app icons on the taskbar
Bug: 297325541
Flag: com.android.launcher3.show_taskbar_pinning_popup_from_anywhere
Test: manual, flip the flag, long-click between taskbar items
Change-Id: If2ee00f31fcd1788bac2c2c0cd78ba1eada86115
2024-11-21 16:38:32 -05:00
Johannes Gallmann 8f8d29888a Merge "Disable 3-button-nav buttons during back button hold" into main 2024-11-20 08:39:42 +00:00
Johannes Gallmann a4b56465ee Disable 3-button-nav buttons during back button hold
Bug: 373544911
Test: TaskbarNavButtonControllerTest
Test: Manual, i.e. verify that pressing buttons in 3-button-nav while the back button is pressed does not have any effect
Flag: com.android.window.flags.predictive_back_three_button_nav
Change-Id: I5abad5f2f74d09c790380a2eeb27aff3b780b925
2024-11-19 22:11:59 +00:00
Winson Chung 6dcbee5d30 Keep nav button container and back button stable during SUW
- Disable translations on both the container and back button while
  in SUW since it's aligned with SUW actions (even in the rare case
  that a user will set up device lock and then lock/unlock the screen
  to show the bouncer while in SUW)

Bug: 346923810
Flag: EXEMPT bugfix
Test: Wipe and go through SUW with device lock
Change-Id: I2d500103e8775d8cf52185d43b3b43cc518884e1
2024-11-15 23:26:52 +00:00
Johannes Gallmann bc4936fb6b Add predictive back animation for 3-button-nav
Bug: 373544911
Flag: com.android.window.flags.predictive_back_three_button_nav
Test: OverviewProxyServiceTest
Test: TaskbarNavButtonControllerTest
Test: TaskbarScrimViewControllerTest
Change-Id: I04cadc660f38e2d4541b06fcda950098a0768492
2024-11-06 11:02:13 +01:00
Sukesh Ram 99c442b015 Revert "Fix Taskbar Y-Translation with Visible Bottom Sheet"
This reverts commit d82503fc42.

Reason for revert: Introduced crashes

Change-Id: I0956f746e25ccfe655169580fd802d33f99c0652
2024-10-28 17:26:47 +00:00
Sukesh Ram d82503fc42 Fix Taskbar Y-Translation with Visible Bottom Sheet
When bottom sheet is visible, such as in SUW or when app launcher pauses, the taskbar three buttons are translated upwards clashing with SUW UI.

Flag: EXEMPT bugfix
Bug: 358532768
Test: Manual
Change-Id: I0d18bda5cb7aeae894f5058df89cc413e34c00fc
2024-10-14 23:41:38 +00:00
Sukesh Ram 9a723c8f21 Refactor Taskbar Button Coloring Code
Given the emergence of b/341190547, this CL seeks to simply refactor the code for readability to aid in investigation efforts.

Flag: EXEMPT bugfix
Bug: 341190547
Test: Manual
Change-Id: I2e42d9c9e8eebd96d4e507b6dd357d7bedcd4a30
2024-10-07 16:03:38 -07:00
mpodolian 989aa8ac83 3 button nav is laid out correctly.
Updated logic of laying out the 3 nav buttons container. Also updated
placement of the hotseat, so it is not shifted on the phone.

Test: Manual. Fold and unfold felix with and without bubbles. Reboot
the devices and perform the same test.
Fixes: 370773620
Flag: com.android.wm.shell.enable_bubble_bar

Change-Id: I7d5ba51f7ded275f7456a8690d04001b9651f6c5
2024-10-03 16:57:58 -07:00
mpodolian 26ed420173 Add teleport animation to the navigation bar.
Whenever the location of the bubble bar is changed, the navigation bar
moves with a "teleport" animation to the opposite side.

Bug: 346381754
Flag: com.android.wm.shell.enable_bubble_bar_in_persistent_task_bar
Test: manual. Drag bubble bar from one location to another observe that
navigation is animated to the opposite side.
Video: http://recall/-/gx8ASgewUeUS3QYohfrd1J/g3zFtGYWFpCsBTkoCAhBUH

Change-Id: I6e32bb7ff7be56a0b616fec8485cc6a97d7ac872
2024-09-27 11:30:56 -07:00
mpodolian dfb48214ea Update placement of the hotseat according to the bubble bar location.
Update the hotseat and Qsb placement according to the 3 nav buttons bar.

Test: Manual.
Set navigation mode to 3 buttons.
On launcher home screen move the bubble bar from one side to another.
Observe that the Hotseat and Qsb moving together with the navigation
bar.
Once moved the bubble bar, expand the bubble bar and collapse it.
Observe how the Hotseat is stashing and un-stashing.
After bubble bar changes position hit the recent apps button, observe
the transition.
On launcher home screen start application with the hotseat icon and exit
opened application. Observe that flying icon comes back to the correct
position in the hotseat.
Video with the above scenarios:
http://recall/-/gx8ASgewUeUS3QYohfrd1J/blTYrKopTyufOcRoPuVpYK
Bug: 346381754
Flag: com.android.wm.shell.enable_bubble_bar_in_persistent_task_bar

Change-Id: Ic8c6acdffbbb111cbe4f3fd6bc60195578d7035d
2024-09-26 19:04:01 -07:00
mpodolian b79e1742bd Fixed the navigation bar placement on device restart.
Moved logic that adjusts the hotseat position from the constructor of
the NavbarButtonsViewController to onTaskbarLayoutChange() method that
is called from the TaskbarViewController TaskbarView layout change
listener.

Test: Manual:
Moved the bubble bar to the default right position. Rebooted the device.
Navigation bar was placed on the left side of the screen.
Flag: com.android.wm.shell.enable_bubble_bar_in_persistent_task_bar
Bug: 367829539

Change-Id: Ife0c48a72b318d6051b7b09bde13818546e65d98
2024-09-19 11:42:29 -07:00
mpodolian 04088ebef7 Update placement of the nav bar in persistent taskbar for 3 button nav
Implemented nav bar placement update to be located opposite to the
bubble bar.
When bubble bar is moved to the other side of the bar, 3 button nav will
swap sides (without animation).
If taskbar has to be repositioned it does that with the animation.

Test: TaskbarViewControllerTest
Bug: 346381754
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: Id031706183c60cbd9c67537b01530acb43bae614
2024-09-12 16:42:15 -07:00
Tracy Zhou 4cbceb1208 Skip nav button animation in gesture nav mode
- Also removed unused rotation button code
- Skip adding certain property holders in phone mode
- Update FLAG_SMALL_SCREEN value from isPhoneButtonNavMode to isPhoneMode, so that it's more aligned with what the name suggests (it shouldn't affect the functionality regardless as the view is invisible in small screen)

Based on https://b.corp.google.com/issues/361593564#comment4

Bug: 361593564
Test: manual
Flag: EXEMPT bugfix
Change-Id: I1de7fa061a6c6aba9f949a0bcf8cfced84273e3f
2024-08-27 21:15:55 -07:00
Tracy Zhou a51ee6a4dc Use isGestureNav signal from TaskbarActivityContext for getTaskbarPhoneDimensions
Somehow deviceProfile.isGestureMode doesn't have the right signal for tests.

We need to look into why dp doesn't have the right signal for isGestureMode in tests. Temporary fix here to unblock pushing the flag to staging

Bug: 359196354
Test: https://android-build.corp.google.com/builds/abtd/run/L05600030005823769
Flag: com.android.wm.shell.enable_taskbar_on_phones
Change-Id: Ie6451812cf4b0c3f034cabdfd4cec726322af0bc
2024-08-15 01:49:40 +00:00
Tracy Zhou 26a3dc8d5c Set navbuttons_view width instead of height in landscape mode
Launcher tests fail in the first run in landscape mode. Somehow this is not reproducible locally or can be seen in production. After digging into hierarchy traces, found that the height of the nav buttons view (in landscape mode) is set to the task bar size (48). Then found where we had this logic historically and adjusted to width in phone landscape mode.

Fixes: 356156690
Test: https://android-build.corp.google.com/builds/abtd/run/L40800030005694733
Flag: com.android.wm.shell.enable_taskbar_on_phones
Change-Id: I170fe45375a63a2e1d2e63b1d680efb45ae0752e
2024-08-07 12:19:59 -07:00
Tracy Zhou 749ea3115c Merge "Fix missing taskbar scrim in folded state when swiping up from immersive mode" into main 2024-07-18 00:47:41 +00:00
Tracy Zhou fe5c3fb5eb Fix missing taskbar scrim in folded state when swiping up from immersive mode
TaskbarTransitions is needed for gesture nav too

Also updated the TaskbarTransitions check so that foldables are included (instead of just phones with the unification for phones flag on

Fixes: 353620747
Test: Scrim shows in Youtube immerisve mode
Flag: EXEMPT bugfix
Change-Id: I9990ef8f793e28b3af2f42b0a5a117fdfbdd4081
2024-07-17 14:04:13 -07:00
Cosmin Băieș eccda9419d Update IME switcher icon in taskbar
This updates the icon of the IME switcher button used in taskbar.

Test: show taskbar and verify icon manually
Bug: 311791923
Flag: android.view.inputmethod.ime_switcher_revamp
Change-Id: I0288601717ab9d0f6842766df62599c51c5a2b4f
2024-07-16 10:26:35 +02:00
Tracy Zhou c97138e93d Fix task bar transitions applied to unfolded task bar
Bug: 350102824
Test: Task bar scrim doesn't happen
Flag: com.android.wm.shell.enable_taskbar_on_phones
Change-Id: Ib0510d9e01b30b50bd5d295b23688547b1decef3
2024-07-01 13:00:46 -07:00
Tracy Zhou 027600a259 Pipe nav bar transitions logic into task bar
Bug: 349155860
Test: manual
Flag: com.android.wm.shell.enable_taskbar_on_phones
Change-Id: Idaf7ecc7b964a2c406ddf4329b64971b08f5d7de
2024-06-25 22:01:34 -07:00
Tracy Zhou 42cfe214cf Do not tint task/nav bar icons in folded state when task bar on phones is enabled
This logic will be handled by TaskbarTransitions instead.

Bug: 349155860
Test: Make sure the buttons don't dim after going to an app in folded, when taskbarOnPhones is enabled.
Flag: com.android.wm.shell.enable_taskbar_on_phones
Change-Id: Ie8efa5c096123935458eb3bb451ace35e8914a30
2024-06-24 13:17:37 -07:00
Chris Göllner 11398e2a36 Shortcut Helper - Integrate with launcher 3 button nav translation
Fixes: 335625543
Test: Unit tests in this CL
Test: Manually
Flag: ACONFIG com.android.systemui.keyboard_shortcut_helper_rewrite DEVELOPMENT
Change-Id: I0367bf4b73994a49ca65b8047bd76d3dc2b3faca
2024-05-13 14:47:57 +01:00
Chris Göllner 0cd995e4ef Convert SysUiState flags from int to long
We already reached the limit of 32 flags for an int. To be able to have
more, changing from int to long.

This is needed, as new flags have to be added.

Flag: NONE
Test: Manually running SysUI and Launcher
Test: Unit tests in CL
Bug: 335625543
Change-Id: Iec1d40218264c7c64c50fd09764aa07c0caa7787
2024-05-13 14:47:33 +01:00
Tracy Zhou cb8eb189f1 Fix 3-button showing up briefly on the AllSet page in setup
Fixes: 338883705
Test: Go through setup. Make sure the 3-button doesn't show up anytime during setup
Change-Id: Idd62486465d608235abe61b994718311c72cb20c
2024-05-05 21:39:54 -07:00
Tracy Zhou 4b43cfbc04 Add ime back button logic to the init block of NavbarButtonsViewController
Fixes: 338320015
Test: Run adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity. Make sure the back key shows by default but hides when IME renders back arrow.
Change-Id: I8baeb10d3f5b13c3bac084872d77d881c1513733
2024-05-01 23:18:29 -07:00
Sukesh Ram 1187fd817e Replace Contextual Rotation Button with Floating Action Button
When foldable is in 3 button, the rotation button is covered by the device’s camera cutout upon rotation.

This CL replaces Contextual Rotation Button with Floating Action Button for taskbar and navbar.

Flag: NONE
Test: Manually tested on Felix & panther.
Bug: 324070001
Change-Id: I8bd9acdeec8ade4c8183c42056bf67b1c825906c
2024-04-29 22:44:00 +00:00
Saumya Prakash da26e19dd8 Adjust where the back button is rendered for new SUW requirements.
Large screen devices in landscape mode and devices that have mostly a
square aspect ratio are undergoing a redesign in Setup wizard that makes
most screens two-pane. As part of this redesign, the back button is
aligned in this change. This change doesn't use a flag because the Setup
Wizard change is not flagged.

Fixes: 323778778
Fixes: 328017929
Test: Run Setup Wizard and see if the back button aligns with the Skip
button in two pane screens.
Flag: N/A

Change-Id: I22680f40c0ddf7cd03ab1da69406eb14184b0174
2024-04-11 16:53:41 +00:00
Tracy Zhou b7efb5cb49 Merge "Only hide back button in SUW when ime is rendering it" into main 2024-02-06 20:24:29 +00:00
Tracy Zhou 419140aede Make sure touch only goes to the nearest button when it makes sense
- In NearestTouchFrame, we can't use view bounds alone since the buttons do not have the same root (3 buttons are in the main container, while the contextual buttons are in the contextual button container). This currently caused the issue that contextual button region, when the contextual buttons are invisible, triggers overview
- Need to add an empty space in the left / top area of the button nav to prevent view clicks from going into back (that's how it works in navigationbar/)

Bug: 25768138
Test: left and right of 3 buttons don't trigger back or overview
Change-Id: Idc26c0c8ac0ecc000300a6db2e3e6251f678dada
2024-01-30 14:27:48 -08:00
Tracy Zhou e502cf3a1b Only hide back button in SUW when ime is rendering it
Bug: 316482919
Test: Back button is visible in SUW when ime is not rendering it
Change-Id: Id3f5d637c9e459a1b7a766187f0c134dd39a05f9
2024-01-29 22:25:36 -08:00
Tracy Zhou 9c9befae5f Use nearest region for all the nav buttons in 3-button folded mode
Bug: 230395757
Test: In 3-button folded mode, make sure that the touches that happen between nav buttons go to the nearest button. No regression in other modes.

Change-Id: Icb776a9a4ed4fc31d33dc3267c7053f2b0da0bfc
2024-01-24 11:06:01 -08:00
Tracy Zhou a009a5e82e Update task bar height update logic to consider screen rotation cases
When home screen rotation is enabled, instead of updating taskbar height (assuming that folded task bar is always on the bottom of screen display), we should update taskbar width instead.

Bug: 313371759
Test: try out both folded and unfolded 3-button and gesture nav modes, enable home rotation, make sure all the nav buttons are functional and visible when they should be.
Change-Id: I16f53d9e9c3cd0229fc50b73613b032a96322b97
2024-01-19 16:58:03 -08:00
Tracy Zhou f46729fd23 Use KeyButtonRipple for button nav
- Matched ripple style
- Matched ripple bounds

Bug: 230395757
Test: Ripple looks the same as the one using navigation bar
Change-Id: I58c773b1f767fb8b0f2570bc4603ea953d589560
2024-01-08 11:54:48 -08:00
Tracy Zhou 95c4c8d268 Fix crash from folding/unfolding
This is fundamentally caused by the phone device profile not having task bar related attributes, which crashes in icon alignment animation. We had resolved it by skipping this animation based on isPhoneMode check. However, we passed in launcherDp instead of taskbarDp (from TaskbarActivityContext) which doesn't always have the most up to date information in race conditions (e.g. repetitively fold/unfold)

Fixes: 311431054
Test: repetively fold/unfold, make sure it doesn't crash
Change-Id: I65f600112da4123d337b3f59a2fe6dd13ac7af74
2023-12-14 18:39:42 -08:00
Tracy Zhou 7fae462565 Pass in navigation bar panel context created by task bar when taskbar navbar unification is on
When the flag is on, task bar is created with window context navigation bar. The floating rotation button window context should be in navigation bar panel.

Fixes: 309930089
Test: N/A
Change-Id: I730a4b898d9fb65cc5d7544dcb37dfe32d49a632
2023-12-05 12:53:51 -08:00
Tracy Zhou 7ce0d39c41 [taskbar/navbar unification] Do not shift back button after unlocking in phone mode
Fixes: 312495129
Test: Back button doesn't move (stay on the left side) when unlocking from the small screen. Back button shifts from the right side to the final position after unlocking from the big screen
Change-Id: Idd9379cee0a0be49c443ee485b4dc0f4ea248366
2023-11-21 19:19:14 -08:00
Tracy Zhou f2d7be1cec Make enableTaskbarNoRecreate() depend on ENABLE_TASKBAR_PINNING and ENABLE_TASKBAR_NAVBAR_UNIFICATION
We want to turn on the flag when either of the dependent features is on

Bug: 299193589
Test: N/A
Change-Id: I7b48ff2be0cf9da3b6bc00d75370fa585ce4140d
2023-11-08 14:52:58 -08:00
Tracy Zhou 6fe69f5a2a Migrate HIDE_NAVBAR_WINDOW to aconfig and rename is to enable_taskbar_navbar_unification
Bug: 309671494
Test: N/A
Change-Id: If35d807c17351146029498a876a055384eff3c2f
2023-11-07 13:51:38 -08:00
Tracy Zhou f11604ee49 Correct signal for showing contextual buttons for taskbar
Apparently isContextualButtonShowing is not the right signal. Checking on dp.isGestureMode instead

Fixes: 300849078
Test: manual
Change-Id: Iac44bb4adbbdd5faf52100c88c2a4a6d95d58b98
2023-10-12 10:43:46 -07:00
Tracy Zhou a9194c54ef Repostion contextual buttons upon layout changes
Also make sure the contextual buttons are centered in its respective orientation

Fixes: 300849078
Test: Rotate around, and make sure the rotation button stays in the same corner
Change-Id: Ibc40739eff050f258b938ccf94c2056ed1ee596b
2023-09-26 19:09:59 -07:00
Tracy Zhou e61fcc9171 Fix wrong 3 button order in landscape mode sometimes
DisplayInfo.rotation doesn't have the correct information sometimes. Switched to use WindowManagerProxy instead.

Fixes: 300528542
Test: rotate the screen between different orientations, make sure the 3 buttons have the right order
Change-Id: Ibafafa9cab8e3f87e20b080868417692b8808dc4
2023-09-14 16:49:18 -07:00
Merissa Mitchell a779330a56 Fix NPE from NavbarButtonsViewController on FEATURE_PC devices.
When FEATURE_PC is enabled on a device,
DesktopNavbarButtonsViewController is instantiated. Previously,
DesktopNavbarButtonsViewController saves an internal copy of
mControllers and the mControllers field in NavbarButtonsViewController
is left unset. This was not a problem because mControllers in
NavbarButtonsViewController was not used in any code that was not
overridden by DesktopNavbarButtonsViewController.

ag/17944073 added some code that accesses mControllers in
NavbarButtonsViewController. Even though the code would be skipped for
FEATURE_PC devices (due to the TaskbarUIController check, which is
overridden by DesktopTaskbarUIController) in the end, it still caused an
NPE.

DesktopNavbarButtonsViewController does not require most of the button
updates done in NavbarButtonsViewController. Regardless, this CL
provides a workaround to avoid the NPE by setting mControllers in
NavbarButtonsViewController in FEATURE_PC devices.

Bug: 296623609
Bug: 297260211
Test: Manual; build and launch sdk_gpc emulator. Ensure that no crash
occurs

Change-Id: Ica22359b96fd0a277c575a238abb194d762e81ea
2023-08-24 17:22:48 -07:00
Tracy Zhou a6bf4c25c8 Update nav button color when nav button layout changes
Bug: 288311605
Test: Rotate the screen in small screen, make sure the button colors are correct
Change-Id: I36ae980fbe239ea4e1ebb63200ee876b690cf218
2023-08-01 11:14:27 -07:00
Winson Chung 55eedd4e5c Merge "Fix an issue with nav bar translations not being updated" into udc-dev am: a53261b9cd am: a8e08175ad
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23923806

Change-Id: Id330daa9c44cad3ef1733ba2319a8b69260ef99b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-07 20:01:36 +00:00
Winson Chung ccd359d76c Fix an issue with nav bar translations not being updated
- There are flows where the shared taskbar state is updated prior
  to being destroyed, and not updated to the latest values when
  the taskbar is recreated.

  ie.
    unfolded -> lock screen -> LauncherTaskbarUiController's
      mTaskbarInAppDisplayProgress[SYSUI_SURFACE_PROGRESS_INDEX]
      is set to 1 due to the notif shade (lockscreen) showing.
      This is written into TaskbarSharedState's sysuiStateFlags
      and inAppDisplayProgressMultiPropValues.
    fold -> TaskbarActivityContext is destroyed
    unlock -> TaskbarManager and TaskbarSharedState's
      sysuiStateFlags are updated while the device is folded
    unfold -> TaskbarActivityContext is recreated and initialized
      which restores from the shared state's
      inAppDisplayProgressMultiPropValues. It also tries to reapply
      the shared state's sysuiStateFlags, but this doesn't update
      inAppDisplayProgressMultiPropValues because the state's
      "enabled" state is not updated (default is no flag set, and
      lockscreen sysui state is not set anymore).
    -> The restored inAppDisplayProgressMultiPropValues value
       results in the wrong translation.

- Note that after the above, the NavbarButtonsViewController state
  is actually correct and reflects the SysUI state, but the
  LauncherTaskbarUiController state is wrong.  This CL tries to
  manually update the ui controller to the correct state when it
  is recreated.
- CL also fixes a separate issue where LauncherTaskbarUIController
  could potentially overwrite the saved state progresses while
  restoring them due to the state callback being called

Bug: 283346744
Test: Unfold -> Lockscreen -> Fold -> Unlock -> Unfold and ensure
      the buttons are translated correctly



Change-Id: I43e473faf4fa2a493b9705506e3755df8f6264e7
Signed-off-by: Winson Chung <winsonc@google.com>
2023-07-06 22:01:49 +00:00
Vinit Nayak 15a9feb67f Add support for taskbar phone 3 button seascape
* Ignore orientation check from ag/22709055 for now,
that will be reverted. This causes recreateTaskbar() to
not run when folding the device

Bug: 274517647
Test: Tested 3 button nav in portrait/landscape/seascape
Flag: persist.wm.debug.hide_navbar_window
Change-Id: Ied02ead677d496b465c748257e32b7db5eb9580c
2023-07-06 13:58:30 -07:00