Commit Graph

116 Commits

Author SHA1 Message Date
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
Jagrut Desai
6bf3af0b81 Match Navigation Icon Colors Folded/unfolded
Recently we did color token migration for Taskbar which included navigation icon also, but phones and foldable device can't really adapt to new color tokens because of contrast issue with underlying wallpapers.

As a result, now home screen which default back to balck and white nav icon colors while all apps and in app navigation icon color will be themed to new GM3 Color tokens.

Test: Manual
Bug: 284408922
Flag: Not needed
Change-Id: I8c8ea11ebb7237885ae4673fda0409ab463b37db
2023-06-16 20:13:15 +00:00
Vinit Nayak
f00760ac23 Prevent taskbar on phone from crashing
* Update code behind flag to work with transient taskbar
* We explicitly set the mDestroyed flag to false in
TaskbarActivityContext because it gets set to true when
the flag is on, but nothing resets it unless it gets
recreated normally.

Bug: 274517647
Flag: persist.wm.debug.hide_navbar_window
Test: Enable flag and verify no crash
Change-Id: I9a149ffb47a10efedfc9dff8399d12d4c1a31553
2023-04-13 14:33:17 -07:00
Jon Miranda
9c478b6c29 Add taskbarIconSize to GridOption/DisplayOptions
- Renamed variables to make it more clear what they represent
- DeviceProfile will be source of truth for taskbar
  sizes

Bug: 265144213
Test: phone, multi-display, tablet
Change-Id: Id9c19d15a65894fd7645e0f876a4b6527b713c34
Flag: ENABLE_TRANSIENT_TASKBAR=true
2023-03-24 12:29:11 -07:00
Tony Wickham
3292947a73 Merge "Restore proper nav buttons translation when taskbar is recreated" into tm-qpr-dev 2023-03-22 15:27:00 +00:00
Mike Schneider
8daf6d804e Merge "Add optional debug logging to on flag changes" into tm-qpr-dev 2023-03-17 07:54:33 +00:00
Tony Wickham
0c6ccca22d Restore proper nav buttons translation when taskbar is recreated
Since mTaskbarInAppDisplayProgressMultiProp is set by various states
that are hard to query in init() (e.g. state of all apps, -1, widgets,
etc.), we store the last mTaskbarInAppDisplayProgressMultiProp in the
TaskbarSharedState and restore those values in init().

Also updated some debug logs in the dump.

Test: manual: from home screen, swipe down to quick settings and toggle
Dark theme, ensure nav buttons don't translate; do the same but over
launcher all apps
Flag: none
Fixes: 267325761

Change-Id: Ib8e6778582ed39c674cd3c1e95312e673659f6a7
2023-03-16 00:06:22 +00:00
Pat Manning
ecc3027c95 Add automirroring to kids mode back button.
Fix: 270629022
Test: manual.
Change-Id: I51957074c0278253a15e0efe9b2b2bcaa8105c4f
2023-03-15 16:03:00 +00:00
Mike Schneider
a79d460736 Add optional debug logging to on flag changes
FlagDebugUtils.formatFlagChange() utility to always write the set of
updated flags, with a list of actual changes applied. Examples:

[allow_gesture|device_dozing] +[device_dozing]
[] -[state_started]

Additionally, moved the appendFlag utility to the new FlagDebugUtils

Test: manually verifed the output in logcat
Bug: 261418621
Change-Id: Ie4f2cfcd4b34f0a816db7845e1df4331babed07a
2023-03-15 13:36:18 +01:00
Brian Isganitis
84261f9d9b Ensure taskbar background always transparent in notification tray.
Persistent, taskbar can be in light or dark modes. Since notification
tray has its own background color, we should hide ours to avoid clashing
with it.

Test: Manual
Fix: 270758899
Change-Id: Iedc6aae42aac30987af3259ccee11c5998e10517
2023-03-08 23:51:34 +00:00
Brian Isganitis
473cfe0a1a Implement light mode for persistent Taskbar.
NavbarButtonsViewController has been massaged to make sure the buttons
contrast well with the color of the Taskbar background that they are on,
if applicable.

Test: Manual
Fix: 268052229
Change-Id: I917a1a1be013c304910b0f674ae8a13abb8e47a1
Merged-In: I917a1a1be013c304910b0f674ae8a13abb8e47a1
2023-03-03 00:35:20 +00:00
Pat Manning
e68ae41196 Rotate back button drawable when IME present.
Currently rotation for IME rotates the whole view, including the background.

Fix: 266874111
Test: manual.
Change-Id: Iea310c99d0714d98ce534a0170316a0fb351f57d
2023-02-07 17:55:59 +00:00
TreeHugger Robot
6e21d310c1 Merge changes I865871e5,Ie655de7a into tm-qpr-dev
* changes:
  Fixes to VoiceInteractionWindowController
  Fix TaskbarBackgroundRenderer not being applied correctly in 2 cases
2023-01-31 17:52:55 +00:00
Tony Wickham
c3963a7ff4 Fixes to VoiceInteractionWindowController
- Make temporary taskbar background behind assistant non-touchable
  (fail-safe in case the window isn't removed for some reason)
- Give temporary taskbar background a different window title and
  add a couple more dump statements to help debugging
- Only show the taskbar background for persistent taskbar; transient
  taskbar can skip most of the special casing and just hide it
- Fix bug where we weren't drawing the separate taskbar background in 3
  button mode
- Fix bug where we weren't actually synchronizing
  separateWindowForTaskbarBackground with TaskbarDragLayer, since the
  former wasn't attached to the window yet; now we wait until it is
  attached before calling synchronizeNextDraw()
- Also added dump logs for TaskbarDragLayerController alpha channels

Test: manual in 3 button and gesture nav (with and without
FORCE_PERSISTENT_TASKBAR enabled)
Fixes: 243652789
Bug: 262664266

Change-Id: I865871e57dd4cb255a916317a7e5d35cfde97df5
2023-01-31 00:58:22 +00:00
Tony Wickham
d9dd02b451 Merge "Remove ALPHA_INDEX_IME_BUTTON_NAV" into tm-qpr-dev 2023-01-30 19:11:47 +00:00
Tony Wickham
602f3074f9 Remove ALPHA_INDEX_IME_BUTTON_NAV
Taskbar already stashes when IME is showing, which hides the taskbar
icons in 3 button mode. Hence this extra flag seems redundant and breaks
Transient Taskbar, which allows unstashing taskbar over IME

Test: Install 3P keyboard, swiping taskbar up over IME still shows icons
Test: Connect physical keyboard, icons still hide in 3 button nav when
the IME switcher is showing
Fixes: 264723145

Change-Id: Iafb89e765668d70a1bfad2e136957a2ef8924514
2023-01-27 17:24:46 +00:00
Winson Chung
39def7300e Fix issue with floating rotation button being in the wrong corner (launcher)
- Add option for the rotation button to be positioned to the right
  when in ROTATION_0

Bug: 265197526
Test: atest FloatingRotationButtonPositionCalculatorTest
Test: foldable-folded (floating rot button in sysui, natural rot=rot_0)
      foldable-unfolded (floating rot button in launcher, natural rot=rot_0)
      tablet (floating rot in launcher, natural rot=rot_270)
Change-Id: I856a0be2e10fceb34254cd58ceb58dfa8a1819bd
2023-01-26 20:41:54 +00:00
Vinit Nayak
b1c47227b1 Add unit tests for TaskbarKeyguardController
* Remove setting back button tint for SUW as that
is now done in ag/20953768

Bug: 230027385
Change-Id: I2c157ed67487cab9ba721fa659973351780509bb
2023-01-18 10:42:45 -08:00
Federico Baron
47d81686e6 Move AnimatedFloat from quickstep to launcher
We are moving AnimatedFloat to launcher to be able to use this in class in launcher. Having it in launcher will allow us to do restore icon treatment animations to do with scaling the icon size

Bug: 254858049
Test: verified that the device still works
Change-Id: I1c4c47ab436c389a94abf7c910c1a44724efc955
2022-12-08 13:58:07 -08:00
Vinit Nayak
209dd03b69 Send corrent SUW insets for taskbar portrait vs landscape
* There were two separate blocks of code for sending insets
for Taskbar during SUW, consolidate those
* We also weren't changing Taskbar window height corresponding
to the added insets/change of height for different
orientations in SUW

Fixes: 253538830
Test: Went through SUW and switched orientations,
no back button overlap

Change-Id: Ifb3bc1c20a793ef062bf338a3bdf933b8ae98c28
2022-11-24 10:29:16 -08:00
Sunny Goyal
d859060860 Merging MultiValueAlpha with MultiPropertyFactory
Bug: 246644619
Test: Presubmi
Change-Id: Id5abc5f3169544656f1139ae17ca59e34ac65dac
2022-10-24 14:38:18 -07:00
Vinit Nayak
2a2fbfe319 Use updateButtonLayoutSpacing() for all states
* During a merge conflict we prevented
updateButtonLayoutSpacing() from running if device was
in setup mode, however the code that does setup layout
is in there.

Fixes: 254589281
Test: Went through setup, back button shows up
where expected

Change-Id: Ib496bfc0e3ac9023a9fc5071867c3779721ab8ab
2022-10-20 23:11:33 -07:00
Vinit Nayak
d6c5147524 Landscape 3 button nav on taskbar phone supported
* TODO: Seascape bar positioning, add tests

Change-Id: I542be2f2f682d8c8a9cdd9bb6c667c44ca167f3e
Merged-In: I542be2f2f682d8c8a9cdd9bb6c667c44ca167f3e
2022-10-17 13:59:18 -07:00
Vinit Nayak
2081742cb7 First pass at Taskbar layout UI polish for SUW
Bug: 231906478
Change-Id: I5d55d1e33f928d4b8034c356565a0f9d8bc5c3fb
2022-10-12 00:04:27 +00:00
Vinit Nayak
7523b94105 Hide back button if IME shows in SUW
Fixes: 230830643
Test: Visually see no back button when IME
shows up on enter pin screen

Change-Id: Icdde92d39962c3891a56bb07de5b16a22635729e
2022-09-29 15:47:15 -07:00
Vinit Nayak
c7295ee37a Add margin to SUW back button
* navButtonsLayoutParams marginEnd was removed, and
SUW was relying on that value to add margins to
SUW back button, but was returning 0.

Fixes: 242999939
Test: Visually observed in SUW test activity
adb shell am start -n com.google.android.setupwizard/.SetupWizardTestActivity

Change-Id: I5ffc421e9b731b0d9c7b7c48eab807d4419721b1
2022-09-29 15:47:15 -07:00
Brian Isganitis
731ef0c301 Properly color taskbar nav buttons when slide-in view is shown.
Supports overriding the current nav bar color with one that would be
visible over a slide-in view.

Demo:
https://drive.google.com/file/d/1MB26QM5qeeyVB6Bj14IGoPCWVT_P7K-3/view?usp=sharing&resourcekey=0-wnMgciNrUXC_l7gI3JFm8A

Test: Manually with light and dark themes, as well as All Apps and EDU
views.
Fix: 248359789

Change-Id: I134ae719b10f3de78ea18220a835de56a82ecb02
2022-09-26 11:41:38 -07:00
Winson Chung
3f649ef892 Update Launcher for removed shared wrappers
- Launcher can reference system code directly now

Bug: 219861883
Test: Builds/Presubmit
Change-Id: I3f656b6c7fce93243ccb7591e52441e99137dec6
Merged-In: I3f656b6c7fce93243ccb7591e52441e99137dec6
2022-09-14 17:14:32 +00:00
Pat Manning
401f6bb0d4 Undim kids nav icons on a11y focus and click.
Fix: 241298057
Test: manual
Change-Id: I9a330bde4641a01b4d19dc83c8f25f56a69328c8
2022-09-01 12:42:04 +01:00
Vinit Nayak
89be3a4c6d Merge "Show 3 button nav on phone in Taskbar (1/2)" into tm-qpr-dev 2022-08-10 03:06:53 +00:00
Vinit Nayak
8a3d05587e Show 3 button nav on phone in Taskbar (1/2)
* TODO: Landscape/seascape support,
        Separate nav spacing out into
        separate class/add tests

Bug: 219035565
Change-Id: I8f5c007f04ea4d6df15962772806356181d764ff
2022-08-09 13:25:50 -07:00
Pat Manning
f3783291ec Skip button layout spacing call when kids nav bar is active.
Fix: 240530037
Test: manual.
Change-Id: Ibf777dfdaab3c81da8feed581a0297f09a62539d
2022-08-05 10:35:07 +00:00
Schneider Victor-tulias
f6003ff070 Merge "Fade out the taskbar icons when animating to overview in 3 button nav." into tm-qpr-dev 2022-07-26 17:29:33 +00:00
Vinit Nayak
c7293179d0 Space out 3 button nav on taskbar
* Add additional margin on nav buttons if
there's overlap w/ contextual button
* End spacing is dependent on grid layout

Bug: 223724516
Test: Tested on unfolded with different
grid sizes.

Change-Id: Ie814f35cd1f35629744050ee3f7242c5a8599883
2022-07-25 13:15:11 -07:00
Schneider Victor-tulias
3f6c473164 Fade out the taskbar icons when animating to overview in 3 button nav.
Bug: 231213105
Test: from home, opened recents, then went back home, then went back to recents, resumed an app, then went back to recents and resumed the same app (both in 3-button and gesture nav)

Change-Id: I83b1b33cafb95353f36a126b93fcaf3b536d3bf4
2022-07-19 11:35:37 -07:00
Tracy Zhou
1092ccacbf Merge "Show IME switcher only when physical keyboard is connected in 3 button nav (instead of also when virtual keyboard is visible)" into tm-qpr-dev 2022-06-29 21:27:17 +00:00
Tracy Zhou
6663ebba3e Merge "Perform haptic feedback on nav button key press" into tm-qpr-dev 2022-06-27 22:55:42 +00:00
Tracy Zhou
849a0c4e81 Show IME switcher only when physical keyboard is connected in 3 button nav (instead of also when virtual keyboard is visible)
Bug: 226489759
Test: connect to a physical keyboard in 3 button nav and make sure the ime switcher shows; and doesn't show with virtual keyboard
Change-Id: Ib9a5880eb1bd6d5b877a9f3789ce858f399c4910
2022-06-24 23:40:41 -07:00
Tracy Zhou
804feb76e7 Fix ime switcher not showing for 3-button nav
Bug: 226489759
Test: connect to a physical keyboard in 3 button nav and make sure the ime switcher shows
Change-Id: Iabde149e8bcd1edacff8e039f956628c69341ecb
2022-06-24 11:17:40 -07:00
Tracy Zhou
0a0fcb809c Perform haptic feedback on nav button key press
Fixes: 203614307
Test: manual
Change-Id: Icaea3f5e436522f23202c20fcc7f7c5dbe309372
2022-06-23 14:29:34 -07:00
Tony Wickham
9a54d2aa43 Hide taskbar while VoiceInteractionWindow is visible
- Fade out icons (or stashed handle if stashed)
- Move background to APPLICATION_OVERLAY layer (behind VIW)
  - Only for gesture nav
- On home screen in 3 button mode, translate buttons down when assistant
  is invoked

Test: Invoke assistant, ensure it draws above taskbar background and
taskbar stops drawing icons or stashed handle
Bug: 225200928

Change-Id: I7807d30df8f358295b8231d89217c7413f32c6f9
Merged-In: I7807d30df8f358295b8231d89217c7413f32c6f9
2022-06-09 05:21:42 +00:00
Brian Isganitis
a9a78117c7 Have separate DeviceProfile instances for taskbar and all apps windows.
We want to scale down the DeviceProfile for taskbar, but the all apps
window should rely on the original DeviceProfile.

Test: Manual
Fix: 232907361
Change-Id: Ia09f674ada9e445c1d7278fa94c536ea9de13ef9
Merged-In: Ia09f674ada9e445c1d7278fa94c536ea9de13ef9
2022-05-25 18:11:51 +00:00
TreeHugger Robot
8d5c3e91cf Merge "Remove long press on home button for kids mode." into tm-dev 2022-05-09 19:22:11 +00:00