Commit Graph

229 Commits

Author SHA1 Message Date
Jagrut Desai bda2a6fb10 Merge "Fix 3-button nav diplacement on lockscreen" into main 2025-03-20 13:49:54 -07:00
Sukesh Ram cb38ecbc8c [CD Taskbar] Null Protect Taskbar against onLauncherVisibilityChange crash
Null Protect Taskbar against onLauncherVisibilityChange crash.

Flag: EXEMPT not adding new behavior
Bug: 403294086
Bug: 404928723
Test: m
Change-Id: I84e899d26f93d484031073d1b63c6757daa8b141
2025-03-20 05:22:18 -07:00
Jagrut Desai 642f8be48d Fix 3-button nav diplacement on lockscreen
Test: Manual
Bug: 375112190
Flag: EXEMPT bugfix
Change-Id: I7f7d82563c2956aaafff91a75e79e4e2b554230e
2025-03-19 16:06:12 -07:00
Treehugger Robot e5cebbd9ca Merge "Do not notify desk mode changes on visible desk tasks count changes" into main 2025-03-17 18:29:02 -07:00
Sukesh Ram 16e04e84eb [CD Taskbar] Move DisplayController method calls to BaseTaskbarContext
To ensure consistent, controllable Taskbar in Connected Displays Behavior, move all independent calls to the singleton DisplayController's various methods into one place in BaseTaskbarContext, where we have access to the parent context and can override default behaviors of these methods throughout taskbar if in external display.

Flag: EXEMPT not adding new behavior
Bug: 401553128
Test: m
Change-Id: If9efc0cfc18bac3ee75bb64bf5280ea979d1faa2
2025-03-17 03:15:45 -07:00
minch c48f662c7d Do not notify desk mode changes on visible desk tasks count changes
1. Trigger `notifyIsInDesktopModeChanged` on
   `visibleDesktopTasksCount` changes only when the multi-desks
   flags are disabled.
2. Make `DesktopVisibilityController.isInDesktopMode` variable
   private and legacy, which should only be used when the multi-desks
   feature is disabled. All the call sites should go to check
   `DesktopVisibilityController.isInDesktopMode(displayId)`, which
    works both with and without the multi-desks feature enabled.

Bug: 402222877
Test: m
Flag: com.android.window.flags.enable_multiple_desktops_frontend
Flag: com.android.window.flags.enable_multiple_desktops_backend
Change-Id: I291e2be6d99e81b0c918ae7f39c17a8cd4ea0918
2025-03-14 15:21:19 +00:00
Sunny Goyal 1ac78b6ec6 Removing listeners from FolderInfo
Folder and FolderIcon are UI objects and can talk to each other directly.
FolderInfo changes are already propogated via model callbacks, and doesn't need a separate listener pattern.

Bug: 398791288
Flag: EXEMPT bugfix
Test: atest FolderTest

Change-Id: Iefd47b8ea12a8ecaf34211a3d908220a0e999187
2025-03-13 10:28:07 -07:00
Sukesh Ram c166a373a9 [CD Taskbar] Make External Taskbar 3-Button & Persistent
The gesture handle still persists in conjunction with the three buttons. In addition to being forced into three button mode, the taskbar on external displays needs to never enter transient mode. More info and before/after images on bug.

Flag: com.android.window.flags.enable_taskbar_connected_displays
Bug: 399718805
Test: Manual
Change-Id: Iff5c297c8ac4823fa24e7a8e4becd0447224cac0
2025-03-10 13:58:21 -07:00
Brian Isganitis 26f9468db1 Animate changes in Taskbar recents indicators.
Flag: com.android.window.flags.enable_taskbar_recents_layout_transition
Fix: 356394053
Test: go/testedequals
Change-Id: Ic018695254bbfea11469c3579e242089b00b90f5
2025-03-07 15:47:48 -05:00
Treehugger Robot 57cab7794a Merge "Simplifying some view iteration methods" into main 2025-03-04 18:42:06 -08:00
Sunny Goyal 476d926972 Simplifying some view iteration methods
Bug: 393703968
Flag: EXEMPT refactor
Test: Presubmit
Change-Id: Ieffa3a66fbf8595d542995c348df578a3aec9083
2025-03-04 10:39:55 -08:00
Brian Isganitis 42c58e39fd Migrate layout transition flag to DesktopModeFlag version.
Flag: com.android.window.flags.enable_taskbar_recents_layout_transition
Bug: 343521765
Test: go/testedequals
Change-Id: I175e428240bc52689efe0f6e4457620ac2efdbb5
2025-03-04 11:30:23 -05:00
Treehugger Robot 1e8125c76b Merge "Merging some notification dots implementation" into main 2025-02-27 16:08:10 -08:00
Jagrut Desai 2ac4d9c794 Merge "Update Taskbar Icon content description to include state description" into main 2025-02-27 15:47:09 -08:00
Jagrut Desai 536097dec2 Update Taskbar Icon content description to include state description
This cl inlcudes: while user is in desktop mode, we will add state description(active, minimized) of each app icon to it's content description.

Test: Manual
Bug: 397555157
Flag: EXEMPT bugfix
Change-Id: Iaec18e7099108e8b076b76c637a41e29ed837265
2025-02-27 09:58:31 -08:00
Sunny Goyal 39063bf167 Merging some notification dots implementation
Bug: 393703968
Flag: EXEMPT refactor
Test: Presubmit
Change-Id: Ie02311afba85f06fbafd265a5015cd23bd356a36
2025-02-27 08:50:26 -08:00
Anushree Ganjam e6065f5a94 Move MainThreadInitializedObject to Launcher3 Go.
Move SandboxContext to a separate class.
Remove all MainThreadInitializedObject references in Launcher3 and tests.
Remove ObjectSandbox interface and make RoboApplication extend
SandboxContext

Bug: 361850561
Test: Presubmit
Flag: EXEMPT dagger
Change-Id: I1a8af5e6ae59df44d8ad6732b4d6e949ac402d6c
2025-02-26 16:49:08 -08:00
Jagrut Desai 8b2e5eff9b Desktop Mode Taskbar Recreate Animation
This Cl includes
       - addition of entry/exit callback methods in DesktopVisibilityController.
       - taskbar manager now listens to desktop mode changes.
       - TaskbarBackrgroundRedererer can now individually animation backgrounds for transient and persistent taskbars
       - new channel for taskbar icon alpha added to TaskbarViewController
       - new animated float to handle background alpha while we are recreating taskbar with animation.

Solution:

we use the callabck we get from DekstopVisibilty for entry/exit to first change logic of when we are considered inDesktopMode. Upon entry/exit we notify display controller for info change.
we also at notify taskbar manager who is now a listener to the desktop mode change and start the recreate process. TaskbarManager first animates existing taskbar out of user view and then follows the original recreate flow.

Test: Presubmit
Bug: 343882478
Flag: com.android.window.flags.enable_desktop_windowing_mode
Change-Id: Ib827564cacd194f499e7d9b1965e2bb13e3548ab
2025-02-24 11:59:53 -08:00
Ahmed Fakhry b6ecf5889e Remove all external usages of GroupTask.task1/2 from Launcher3
See go/refactor-group-task for details. This CL removes all the usages
of `task1` and `task2` from `GroupTask` in Launcher3. Follow-up CLs will
remove it from NexusLauncher and remove the fields altogether.

Bug: 388593902
Test: m
Flag: EXEMPT pure refactor with no behavior change.
Change-Id: I902c8135b3a0aae95acf25267b3bcbf286bd4e7d
2025-01-31 17:14:44 +00:00
Fengjiang Li 90e83779f2 [Leak] Clear all of TaskbarView's FolderIcons' listeners upon activity onDestroy
Fix: 390200556
Test: manual
Flag: NONE - released code
Change-Id: I4f6fd2fb0b263169bd5e59e90b321cedfc22f4de
2025-01-15 14:58:14 -08:00
Mykola Podolian fc8db9afc3 Merge "Shift transient taskbar to ensure 12dp distance with the bubble bar." into main 2025-01-13 12:52:21 -08:00
Brian Isganitis 791944ff63 Merge "Disable model loading with Sandbox check instead of static boolean." into main 2024-12-19 15:32:56 -08:00
mpodolian 226ed8143d Shift transient taskbar to ensure 12dp distance with the bubble bar.
Shift the taskbar to fulfill the 12dp distance if the distance between
the taskbar and the bubble bar is below this threshold.

Fixes: 376929094
Test: TaskbarViewControllerTest
Test: Manual. Test that the transient taskbar shifts properly.
Increased the minimum distance to 120 dp and verified that the taskbar
shifts correctly. Moved bubbles side to side, confirming the taskbar
follows. The return-to-home-screen animation to the hotseat plays as
expected from either side.
Video:
http://recall/-/gx8ASgewUeUS3QYohfrd1J/bJZ8PclmltZu7IupvBFrLn
Test: Manual. Test that the transient taskbar stashes properly.
Increased the minimum distance to 120 dp and verified that the taskbar
shifts correctly. Go to any application. Stash and un-stash the taskbar.
Video:
http://recall/-/gx8ASgewUeUS3QYohfrd1J/hCGRhUgIqvcehOrTQ2Ulvj
Test: Manual. Test that the transient taskbar pin/unpin properly.
Increased the minimum distance to 120 dp and verified that the taskbar
shifts correctly. Pin/unpin the taskbar.
Video:
http://recall/-/gx8ASgewUeUS3QYohfrd1J/f3fy5JKVZAk4wLCpVra4DK
Flag: com.android.wm.shell.enable_bubble_bar

Change-Id: Id4bd713da93053f90d9c2be8503dc93531a03b29
2024-12-18 15:51:37 -08:00
Brian Isganitis 002ef1f550 Disable model loading with Sandbox check instead of static boolean.
The static boolean also affects Taskbar within the Launcher process. We
only want this disabled for the Taskbar test Sandbox.

Flag: TEST_ONLY
Bug: 230027385
Test: NexusLauncherTests:com.android.launcher3.taskbar
Change-Id: Ife12e95ab34755d1aec42d79188c15232d8da092
2024-12-10 23:31:36 +00:00
mpodolian 3e419ebbf1 Remove usage of the enableBubbleBarInPersistentTaskBar flag.
Remove and merge the usage of the enableBubbleBarInPersistentTaskBar
flag to the enableBubbleBar flag.

Bug: 383181643
Flag: com.android.wm.shell.enable_bubble_bar
Test: NONE - removed and merged flag usage.
Change-Id: I4f131e1ddf8367425b91c8fb597857ee222b75d8
2024-12-10 15:10:49 -08:00
Brian Isganitis 3c24c421f6 Animate out/in the correct task view when recents change.
Flag: com.android.launcher3.taskbar_recents_layout_transition
Bug: 343521765
Test: go/testedequals
Change-Id: I6c7708ed9f03eff8469b5f2e75ce00e545b03f54
2024-12-09 15:35:43 -05:00
Brian Isganitis 8e2b850df7 Implement initial LayoutTransition for Taskbar recents.
The animations mostly match the spec, though the recents indicators scale/fade with icon currently.

The change transitions need to incorporate translateX since that changes based on the number of icons in Taskbar. We need the translateX for pinning update to happen before TaskbarView lays out its children so that the animator computes the correct start and end values.

Flag: com.android.launcher3.taskbar_recents_layout_transition
Bug: 343521765
Test: go/testedequals
Change-Id: I13aa49abf80ddc09fab890f78bde924a8f7f1d6e
2024-12-09 15:35:43 -05: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
Toni Barzic 7a0191e753 Add unit tests for taskbar overflow
The tests verify that number of icons in the task bar does not go beyond
the intended max number, that the taskbar remains centered as it hits
max number of icons, and maintains a minimal margin to the display
edges.
Also, has a test that the max naumber of icons and the taskbar margins
adapt as bubble bar visibility chages.

Adds a TestRule to mock the recents model in the taskbar window sandbox.
The mocked recents model is used to add fake running app icons to the
taskbar.

Bug: 368119679
Test: atest TaskbarOverflowTest
Flag: EXEMPT test only

Change-Id: I8d033c3e95d7c0a4b139502cd7d70882482117c0
2024-11-20 01:48:54 +00:00
Jagrut Desai 596594c684 Fix launching app animation from launcher all apps.
This cl includes
	- making pinned taskbar animate slide in/out animation from bottom of screen.
        - no icon aligment with hotseat when taksbar is pinned

The solution
	- upon state change applied on TaskbarLauncherStateController. offset taskbar background and icons to bottom of screeen and animate with slide in/out effects.

Test: manual, presubmit
Bug: 314279101
Flag: EXEMPT bugfix

Change-Id: Ife336ebd57eb2f60c2bc33ed6a4527c42111808f
2024-11-14 15:51:50 -08:00
Toni Barzic 28ebd1bacd Account for bubble bar bounds for taskbar overflow
When caculating number of icons to show in taskbar, account for bubble
bar size (the max size when in collapsed state) when bubble bar has
bubbles (even if the bubble bar is stashed). Note that the bubble bar
visibility may change, so max number of icons in the taskbar may change
during the taskbar view lieftime. TaskbarViewController already had a
method called when the bubble bar visibility changed - adapt it to also
reclaculate max number of icons to show in the taskbar, and update the
list of icons shown in the UI if necessary (if the change in the bubble
bar visibility would also cause a change in number of icons shown in the
taskbar).

Bug: 368119679
Test: Launch enough apps for taskbar to enter overflow, open an app that
supports bubbles, and trigger 2 or more bubbles so bubble bar shows up.
Verify that the buble bar does not overlap with taskbar bounds, both
in transient and persistent taskbar. Remove bubbles, and verify the
taskbar bounds expand, allowing more icons to be shown.
Flag: com.android.launcher3.taskbar_overflow

Change-Id: Ifed4e5e5dd64df5256090f5ba55f24203c09e839
2024-11-12 18:40:40 +00:00
Gustav Sennton 461caa7c5f Support Desktop unminimize animations, and move app-state logic
- Support Desktop unminimize animations through
    1. keyboard alt-tab shortcut
    2. taskbar hotseat icon click (TaskItemInfo)
    3. taskbar running-app icon click (GroupTask)
- move taskbar running-app state logic from TaskbarViewController to
  TaskbarRecentAppsController.

Test: manual - ensure the transitions above cause unminimize animations
Bug: 369966334
Flag: com.android.window.flags.enable_desktop_app_launch_alttab_transitions

Change-Id: I20322bdf58bc69cff360bf26e533e0732d5297b9
2024-11-05 13:39:46 +00:00
Sukesh Ram 4781b26bf4 Merge "Revert "Fix Taskbar Y-Translation with Visible Bottom Sheet"" into main 2024-10-28 21:42:54 +00: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
Treehugger Robot 1e4f42ff7f Merge "Account for all apps offset during taskbar layout" into main 2024-10-24 00:10:08 +00:00
Toni Barzic a5b6c155b6 Update taskbar overflow button
Creates a new view for the taskbar overflow button that draws up to 4
recent item previews. The items are stacked on top of each other in
counter clockwise order, with overlapping bounds, recent items closer
to the top. The item icons have a 2 dip ring around them, of the taskbar
background color.

Adjusts logic to calculate which items become part of the overflow
button, so more recent items get shown in the taskbar.

Initial consideration was to usse FolderIcon to represent the overflow
button, but decided against it because:
*    FolderIcon is fairly entangled with the associated folder view
*    item information uses different data structure (ItemInfo) than
     recent items (GroupTasks)
*    item preview layout within the main icon is similar, but
     sufficiently different that using clipped folder layout rules felt
     like hacking around assumptions made for folder icon UI

Bug: 368119679
Test: Keep opening apps until the task bar enters overflow - verify that
overview button shows up, and contains least recent task
representations. Keep adding items, then closing windows, and verify
the icon gets updated accordingly. Done in landscape and portrait, and
ltr and rtl layout.
Flag: com.android.launcher3.taskbar_overflow

Change-Id: I2824cb0db1f7516ebd74361ce00fb8887857325d
2024-10-23 17:05:58 +00:00
Toni Barzic 9a5941ab91 Account for all apps offset during taskbar layout
When laying out its contents, TaskBarView generally lays the icons so
they get centered in the task bar - this is done by calculating the
total size of all icons during layout (this will generally be transient
taskbar icon sizes), and substracting extra margins that get removed
from the divider view. After initial layout, `TaskbarViewController`
adjusts the icon view positions to match expected icon sizes (it
offsets icons horizontally reducing margins between icons to match
intended icon sizes for the taskbar type). Additionally,
`TaskbarViewController` translates all apps button container - this
transformation is asymetric, and causes the task bar contents to become
off-center. To account for this, update taskbar layout to reduce the
total icon size used for centering icons by the amount all apps button
is offset. This makes the taskbar off-center after initial layout, but
by the amount by which all apps button is eventually offset (resulting
in centered taskbar content).

This alone worked for left-to-right UI direction, but not right-to-left.
To fix this, correct the reference point from which
TaskBarViewController offsets icon positions. The offset used to be
calculated by distance of an icon index from half of the icon count -
instead offset needs to be calculated relative to mid-index.
For example, icon at index i needs to be offset by
(mid_index - i) * difference_in_icon_size: ((n-1) / 2 - i) * diff).
Code used to work for LTR UI layout because the list of icons contained
invisible qsb view, which incresed both n and indices by 1, so
(n' / 2 - i') * diff_in_icon_size worked fine, as it evaluated to
((n + 1) / 2 - i - 1) * diff = ((n - 1) / - i) * diff

Bug: 372567501
Test: Verify that taskbar icons are centered when it needs to be, both
with ltr and rtl language UI.
Flag: EXEMPT bugfix

Change-Id: Ic06873cc225a4361d9140d72c055db23f446a1ad
2024-10-21 20:49:05 +00:00
Toni Barzic 6957a037fe Make mAllAppsButtonContainer not Nullable
Bug: None
Test: None
Flag: EXEMPT cleanup
Change-Id: Iebf2eff8e9657e5960375f80a0f5bc4d46dcead3
2024-10-18 17:14:01 +00:00
mpodolian 1d4e75c777 Refactored hotseat translation X logic
Made retrieval of the hotseat translation X easier to use.

Test: Manual. Set the navigation mode to 3-button. Moved the bubble bar
from one side to the other. Switched the navigation mode to gestures.
Moved the bubble bar from one side to the other again.
Bug: 373422448
Flag: EXEMPT refactoring

Change-Id: Ie69f1ecf178244008e5c752882c4b91a30928756
2024-10-17 09:46:47 -07:00
Mykola Podolian 79032facbf Merge "Created a helper method that calculates the hotseat icons shift X." into main 2024-10-16 00:12:44 +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
mpodolian 51e2bb31ed Created a helper method that calculates the hotseat icons shift X.
Moved out logic that computes the translation X for the hotseat icons.

Fixes: 368379159
Test: Manual. Have the hotseat adjusted. Open any application from the
hotseat bar. Go back to home.
Flag: EXEMPT refactoring

Change-Id: If9dfa70be537f87b075bd865e7f9c5cd1ae78f00
2024-10-09 12:17:01 -07:00
mpodolian 3dcb19f33a Fixed the hotseat placement in RTL mode
Updated logic that computest the hotseat shift.

Fixes: 372014534
Flag: com.android.wm.shell.enable_bubble_bar
Test: Manual. Put device into 3 buttons navigation mode, force RTL.
Hotseat is placed next to the navigation buttons bar.

Change-Id: Ie7b6be11a093ffa4006182bdc0b73018ba799246
2024-10-07 10:34:42 -07:00
Mykola Podolian 409b62cb33 Merge "3 button nav is laid out correctly." into main 2024-10-04 20:01:58 +00: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
Treehugger Robot 6d763a301c Merge "Fix Taskbar unlock transition" into main 2024-10-02 00:14:04 +00:00
Tony Wickham 7519b7c2e6 Fix Taskbar unlock transition
- There are multiple signals that come just after FLAG_DEVICE_LOCKED
  is removed, and those should still be considered part of the unlock
  transition. We already did this for TaskbarStashController so I copied
  it to TaskbarLauncherStateController.
- Also animate when changing SYSUI_STATE_OVERVIEW_DISABLED, since this
  happens when the device is locked/unlocked and changes the visibility
  of TaskbarView icons.

Test: manually unlock over both home screen and in-app, verify clean
transition without jump (e.g. Hotseat is immediately visible as part of
Workspace, and Taskbar fades in during unlock to an app)
Flag: EXEMPT bug fix
Fixes: 364586744

Change-Id: If0497fcc17bb0ec44294c4ea1163104b4d8be459
2024-10-01 20:09:05 +00: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
Mykola Podolian 6f231f694d Merge "Update placement of the hotseat according to the bubble bar location." into main 2024-09-27 15:45:04 +00: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