Commit Graph

23 Commits

Author SHA1 Message Date
Marcelo Arteiro
bc02103a6a Migrate materialColor* attributes into colors
TLDR:
* This change should not break anything or change any color.
* Simplifies theming and styling while improving developer experience.
* With this  developers can often skip styling for color entirely, while ensuring consistency and preventing accidental overrides.

Bug: 374273611
Test: presubmit
Flag: EXEMPT bugfix
Change-Id: Id19038078e83c73847b1a7c686c3a3df1ecccac2
2024-11-21 13:08:11 +00:00
Alex Chau
a2c1dbc611 Update corner radius calculation in TaskView
TaskThumbnailView
- Set cornerRadius directly from TaskView instead of calulating and listening from ViewModel
- Use onSizeChagned/width/height for OutlineProvider bounds, to be consistent with DesktopTaskContentView

DesktopTaskView
- Moved backgroundView inside DesktopTaskContentView, so its outline can be determiend by OutlineProvider in DesktopTaskContentView
- Update DesktopTaskContentView's cornerRadius when it changes in TaskView

Model/Data chagnes
- Removed TaskViewModel/TaskViewData and scale from RecentsViewData

TaskView
- Add a onBind method to be called after bind, for common post bind handling (e.g. update cornerRadius)

TaskViewSimualtor
- Use DesktopFullscreenDrawParams for desktop task, and moved setIsDesktopTask to CTOR so related fields can be final

Bug: 372237039
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Flag: com.android.window.flags.enable_desktop_windowing_mode
Test: TaskThumbnailViewScreenshotTest, OverviewDesktopTaskImageTest
Test: DesktopFullscreenDrawParamsTest, FullscreenDrawParamsTest, TaskThumbnailViewModelImplTest
Change-Id: If3d195ef6596aa28fce4d4875cf45423cb71811c
2024-11-20 13:55:32 +00:00
Sam Cackett
1ecdc2d712 Revert "Revert "Don't allow Desktop tasks to go outside Overview..."
Reland submission "Don't allow Desktop tasks to go outside Overview task bounds"

Reverted changes: /q/submissionid:30210454-revert-30114356-desktop-task-view-corner-clipping-KXYKHZHSWL

Change-Id: Ia263edcc876f9f72ca7f70733e96b0823dbd750e
Fix: 376206104
Flag: com.android.window.flags.enable_desktop_windowing_mode
Test: OverviewDesktopTaskImageTest, TaplTestsOverviewDesktop
2024-11-04 10:40:57 +00:00
Manusaran Reddy Avula (xWF)
e906e733be Revert "Don't allow Desktop tasks to go outside Overview task bounds"
Revert submission 30114356-desktop-task-view-corner-clipping

Reason for revert: Culprit for b/376872073

Reverted changes: /q/submissionid:30114356-desktop-task-view-corner-clipping

Fix: 376872073
Bug: 376206104
Change-Id: I51c8b11a868a727145f0bc8a6feb13352a8cbead
2024-11-04 10:00:23 +00:00
samcackett
3ae3d297e6 Don't allow Desktop tasks to go outside Overview task bounds
Wrap TaskThumbnailView's in a new DesktopTaskContentView. This is in order to correctly crop the thumbnail children contained in the DesktopTaskView, otherwise any freeform task screenshots at the edges of the DTV leak outside the bounds.

We need a new container to do this, otherwise we will cut off the icon
or the hover border if we apply an outline to the DesktopTaskView itself.

Fix: 376206104
Flag: com.android.window.flags.enable_desktop_windowing_mode
Test: OverviewDesktopTaskImageTest
Change-Id: Ic51438e63aaf671a0a8156815d11fc7fa12beac0
2024-10-30 07:22:45 +00:00
vinayjoglekar
95e590229a Announce “Desktop” when focusing on the desktop mode in Overview
https://drive.google.com/file/d/1MNUyDtRhyU8tKRZ5JONLAeUBQ_8Vrids/view?usp=drive_link

Test: NA
BUG: 329375034
Flag: com.android.window.flags.enable_desktop_windowing_mode
Change-Id: I36460002be94697746fb085e4aeca9a6ac804002
2024-08-13 13:16:10 +00:00
Alex Chau
1ceac5ddfe Implement e2e test for desktop windowing
Code changes:
- TaskView, GroupedTaskView and DesktopTaskView now uses different resId, so it can be differentiated by TAPL
- Extracted result handling of icon loading, so we can override in DesktopTaskView
- DesktopTaskView now load icons, so titleDescription can be loaded. When icons are loaded, contentDescription are applied to respective snapshotViews; icon unloading is ignored
- Track launchDesktopFromRecents and composeRecentsLaunchAnimator in TAPL events so we can test if the TaskView launch path is correct

Test changes:
- Added TaplTestsOverviewDesktop that move 2 TestActivities into Desktop, and launch the DesktopTaskView as static and live tile
- TaplTestsOverviewDesktop is limited to Tangor/cf_tablet only, and added LimitDeviceRule to AbstractLauncherUiTest to enable @AllowedDevices and @IgnoreLimit

TAPL changes (2 APIs added/modified):
- Changed TaskView matcher to use id/task_view_* to match all TaskView types
- When Overview is launcehd from Background, mark the currentTask after the launch as liveTile. When an OverviewTask has the same accessibility node as the liveTile, it'll expect different event when launching.
- [API change] BaseOverview.getTestActivityTask can now matches mutiple test activiites, useful for matching GroupedTaskView and DesktopTaskView; Fix a bug that getTestActivityTask wrongly use `getParent()` which is RecentsView to match activityName.
- In OverviewTask.open, we'll expect different events based on TaskView types and whether it's a live tile. Launching DesktopTaskView will in additional verify Desktop header is present on screen.
- [API change] In OverviewTaskMenu, support tapping Desktop menu and verify Desktop header is present on screen.
- Removed unused OverviewTaskMenuItem

Fix: 320313527
Test: TaplTestsOverviewDesktop
Flag: com.android.window.flags.enable_desktop_windowing_mode
Change-Id: I89261c787364901320f3acb18f01ddad5f62d17c
2024-08-08 10:37:40 +01:00
Marcelo Arteiro
f38d98d1a6 Align color resources in launcher projects.
This is an effort to align/unify color usage across all launcher projects and the system itself.
This fix recreates all dynamic color attributes present in the OS since many launcher areas cannot access private attributes.
It is recomemnded to use these new local attributes in all launcher areas and avoid creating new color resources when these can be used directly.

Bug: 352690172
Test: Presubmits
Flag: EXEMPT bugfix
Change-Id: Ic36b8bf70ee37f2fdd32e459e66f0e2d001d6ba2
2024-07-19 14:22:21 +00:00
Alex Chau
3fde467b41 Make DeskopTaskView use latest TTV
- Made TaskThumbnailViewDeprecated nullable in TaskContainer, with non-null getter that requires feature flag to be on/off
- Removed TaskThumbnailViewDeprecated.setTaskOverlay, as it'll now be null with feature flag on
- Removed TaskThumbnailViewDeprecated from DesktopTaskView xml
- Simplifed DesktopTaskView binding logic, to always get thumbnailViews from viewPool, removeView and recycle all thumbnailViews in onRecycle
- Didn't implement view pooling of TaskThumbnailView due to difficulty with TaskContainer not being recycled togetehr with TaskThumbnailView

Bug: 338360089
Test: TaskThumbnailViewModelTest
Test: manual testing for DesktopTaskView for both enable_refactor_task_thumbnail on and off
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Flag: com.android.window.flags.enable_desktop_windowing_mode
Change-Id: I38a6dfc6bc561689578d1660794f91d30bad4a68
2024-07-05 18:39:56 +01:00
Alex Chau
4205013b0a Recycle thumbnailViews in DesktopTaskView
- Changed mTaskContainers to a List
- Added an XML for TaskThumbnailView to make it compatible with ViewPool
- Removed mSnapshotViews variable, and streamlined DesktopTaskView binding logic to re-use thumbnailvIew from mTaskContainers or ViewPool

Bug: 249371338
Fix: 251586230
Test: manual
Flag: ACONFIG com.android.window.flags.enable_desktop_windowing_mode DEVELOPMENT
Change-Id: Iab7575e9c36b8ebf3eb62f19f13d75ba671f9f4f
2024-05-08 22:19:27 +00:00
Uwais Ashraf
e21525da40 Add a refactored TaskThumbnailView
- Live Tile, swipe (left+right) and dismiss working
- Tests of ViewModel state transitions
- Deprecate the old TaskThumbnailView
- Renaming TaskThumbnailView to TaskThumbnailViewDeprecated

Fix: 335440878
Fix: 331754672
Bug: 331753115
Test: TaskThumbnailViewModelTest
Test: Attached video on bug
Flag: ACONFIG com.android.launcher3.enable_refactor_task_thumbnail DEVELOPMENT
Change-Id: I063b957fe6e56960970dcaadc641848fbd73251c
2024-04-23 23:05:14 +01:00
Jordan Silva
ebd71c6cc9 Refactoring TAPL functions for OverviewTask
This CL refactors some methods in OverviewTask to rely on OverviewSplitTask. It also changes the BaseOverview getTasks function to retrieve the parent task and support cases where only the bottomright_snapshot is available in the recent tasks.

Bug: 320633351
Test: TaplTestsSplitscreen
Flag: N/A
Change-Id: I226f895810ce3b46cc107f76cd85e2918abf7088
2024-02-05 13:50:23 +00:00
Sanatt Abrol
a6b4e1bc43 Bug: b/307278302
Fix clipping of DesktopTaskView border on focus/ hover

Hover border: https://screenshot.googleplex.com/B9CUW49q6inMW75
Focus border: https://screenshot.googleplex.com/36uLJ4jC295t7PZ

`android:clipToOutline` prevents drawing outside view bounds and results in the focus/ hover border getting clipped, instead we can use `android:clipToPadding` with a small non-zero padding to clip children and allow drawing a border outside the bounds

Change-Id: I7e763f7ee8c7fd1090c7778c2c000d2b792bef06
2023-11-21 10:48:08 +00:00
Sam Dubey
0552d37f34 Revert "Update Tapl tests for enable_grid_only_overview"
Revert submission 25220083-b/283246928

Reason for revert: b/308930958

Reverted changes: /q/submissionid:25220083-b/283246928

Bug: 283246928
Change-Id: I69ce128061f7ffad213f8f193122b18e5ee9378d
2023-11-02 13:33:55 +00:00
Alex Chau
3029b8314e Update Tapl tests for enable_grid_only_overview
- Add "task" as id for TaskView, and use it instead of "snapshot" when creating OverviewTask, so that for split tasks are caputred as a whole in getCurrentTask and getTasks
- Fix getCurrentTask() to correctly get the top-right tasks in grid only overview. It'll first get the widest task, and then top, and then rightmost task
- Fix scrollLeftByDistance() to correctly account for leftGestureMargin to make sure it scroll by distance provided
- Fix scrollCurrentTaskOffScreen() to actually scroll the task off screen
- Fix createAndLaunchASplitPair() to use Task menu instead of Overview actions for grid only overview
- Skip testOverviewActions() in grid only overview, where Overview actions isn't available
- Fix testOverivewForTablet to expect the correct task in grid only overview; also disabled part of a test due to an animation bug in Overview
- Fix dismissBySwipingUp() to swipe from bottom of task, which is required to effectively dismiss top row tasks
- Also fixed OverviewTask to correctly get objects in FallbackOverview

Bug: 283246928
Test: presubmit
Flag: None
Change-Id: I5dd39b1779ea02738556f921169dbe38aa4cba8c
2023-11-01 22:15:12 +00:00
Pat Manning
1695cc724c Create icon app chip menu for overview tasks.
Fix: 257951354
Test: TaplTestsQuickstep
Test: TaplTestsSplitscreen
Flag: ENABLE_OVERVIEW_ICON_MENU
Change-Id: Id8a14b1970ae42bcc74e95419caeaf52ef63638b
2023-10-02 12:51:56 +00:00
helencheuk
27f23c7a35 Re-land "Add hover state border to overview task item"
Fix: 249859410
Test: b/291266459
Change-Id: I5ac1e9e77439e587f11c994d22fdc72d20d8502d
2023-07-20 18:35:22 +01:00
Schneider Victor-tulias
e5c7d7dcd2 Polish the keyboard quick switch view and border animation colors
Flag: ENABLE_KEYBOARD_QUICK_SWITCH
Bug: 276336349
Test: keyboard quick switched on tablet and handheld
Change-Id: I2c21737db3fc4c332ffef9098e8d05d998cf3c39
2023-04-07 13:29:32 -07:00
Marcelo Arteiro
dec6428014 Automated Token Alignment Android/Material
Test: Treehugger
Bug: 268682423
Change-Id: I1127f729935c52f80f16c468316822fac351fc54
2023-02-20 15:35:01 +00:00
Ats Jenk
ae7e03440c Add support for showing border for desktop tile
When a external keyboard is connected and ENABLE_KEYBOARD_QUICK_SWITCH
feature flag is enabled, we highlight the selected tile in overview.
Add support to the new desktop tile to show the highlight.

Bug: 269342116
Test: connect an external keyboard, use alt+tab to open overview and
  switch between the tiles
Change-Id: I29ac5864776a9a251ecdb0cb4b741b12747de564
2023-02-14 14:40:07 -08:00
Ats Jenk
78b614f555 Add icon to desktop tile in overview
Copied over icon from caption desktop button in WMShell. Temporary icon
for now.
Refactored some logic in TaskView to better support for custom
orientation handling in subclasses. Subclasses can override setting
orientation for icon or thumbnail.

Bug: 267326722
Test: manual, enable desktop windowing proto 2 and go to overview
Change-Id: Id66d48fa52a418a07b954a384b2c3ea22f091b1f
2023-02-10 10:16:31 -08:00
Ats Jenk
6f50ca34c4 Pin desktop tile to the right in overview
When desktop windowing prototype is enabled, pin desktop tile to the
right of the focused tile.
Also making desktop tile persistent so it will always show up,
regardless whether there are tasks added to the desktop or not.
Fixing some nullpointer issues that stem from that.

Bug: 261234155
Test: no recent tasks, go to overview, shows empty view
Test: only desktop tasks, go to overview from home, desktop tile focused
Test: only desktop tasks, desktop open, go to overview, desktop tile
  focused
Test: 1 fullscreen task and some desktop tasks, go to overview from home
  screen, fullscreen tile focused
Test: fullscreen task open and no desktop tasks, go to overview,
  fullscreen task focused and empty desktop tile on the right
Test: fullscreen task open and some desktop tasks in background, go to
  overview, fullscreen tile focused, desktop tile on the right
Test: some desktop tasks focused, some fullscreen tasks in background,
  go to overview, desktop tile focused, fullscreen tasks on the left

Change-Id: Ib28185b40f639d36b82b6d0e3c61026ec84e245c
2023-02-03 17:29:43 -08:00
Ats Jenk
3c59d9b345 Desktop tile that is a snapshot of desktop
Create a desktop recents tile that shows a snapshot of the freeform
tasks running on desktop.
Scales them down and positions them in the same location as they would
be on the desktop.

Bug: 244348395
Test: manual
Change-Id: Ieb5830a331691844769003189f557c4b7e4cd35c
2022-10-10 15:50:31 -07:00