Commit Graph

24 Commits

Author SHA1 Message Date
Jordan Silva
2de6a277b7 Update responsive grid spec cell size remainderSpace logic
Refactoring the cellSize spec of responsive grid to divide the remainder space in code instead of dividing by cols/rows in the spec definition. For example, instead of using 0.2 in the spec for 5x5 grid (1 / number of rows), it is going to use 1 (100% of the remainder space) and divide the percentage by the number of cols or rows in code.

Fix: 313621277
Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD
Test: NexusLauncherImageTests
Test: CalculatedWorkspaceSpecTest
Test: DeviceProfileDumpTest
Test: DeviceProfileAlternativeDisplaysDumpTest
Change-Id: Ifaec838ac9751562ecedc1fe39b966ee3d092de3
2024-01-08 19:40:01 -03:00
Jordan Silva
4c09958671 Validate responsive specs using more than 100% of remainder space
Fix: 313463517
Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD
Test: ResponsiveSpecsProviderTest
Change-Id: Ic80846d27dabd8d57f43b35581174bd2f2f3611b
2023-11-28 15:11:27 +00:00
Jordan Silva
999dd2a06f Extract cell size information to responsive grid structure
Bug: 287975993
Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD
Test: ResponsiveCellSpecsProviderTest
Test: DeviceProfileDumpTest
Test: DeviceProfileResponsiveDumpTest
Change-Id: I26a87d9b690fdfcff1599d862c09e97fe9f9f930
2023-11-24 12:39:36 +00:00
Jordan Silva
8f7986abae Responsive grid cleanup
This CL renames some of the variables to keep it consistent across the code. It removes workarounds that were made to facilitate easy code reviews without breaking the tests.
It is a cleanup of the responsive grid feature.

Bug: 299889733
Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD
Test: CalculatedAllAppsSpecTest
Test: CalculatedFolderSpecTest
Test: CalculatedHotseatSpecTest
Test: CalculatedWorkspaceSpecTest
Test: AllAppsSpecsTest
Test: FolderSpecTest
Test: HotseatSpecsTest
Test: WorkspaceSpecsTest
Change-Id: I198fadfbcfc0d1b32a62a3076949b42ee1fbcf33
2023-11-09 22:06:03 +00:00
Jordan Silva
d7c7eaf837 Update Responsive Grid tests with aspect ratio group
Adding aspect ratio group and updating the responsive grid tests to match the refactored classes.

Bug: 299889733
Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD
Test: AllAppsSpecsTest
Test: CalculatedAllAppsSpecTest
Test: HotseatSpecsTest
Test: CalculatedHotseatSpecTest
Test: WorkspaceSpecsTest
Test: CalculatedWorkspaceSpecTest
Test: ResponsiveFolderTest
Test: CalculatedFolderSpecTest
Change-Id: I918f4e28eb310bc9300fc6cc2b5b2af67d758a96
2023-11-07 11:51:28 +00:00
Jordan Silva
e4d7aaa6fd Fix to prevent unsorted breakpoints returning wrong spec
It orders the breakpoint list to guarantee that the smallest breakpoint is always returned for a given availableWidth or availableHeight.

Fix: 301396419
Flag: ENABLE_RESPONSIVE_WORKSPACE
Test: CalculatedWorkspaceSpecTest
Change-Id: Ia545e84150027bd8daa8d0dde58ff6fc579c3b6a
2023-09-21 11:44:56 +01:00
Thales Lima
1f19c95d95 Create new hotseat spec tests
Refactor DeviceProfileDumpTest to use files instead of inline strings.

Fix: 292204436
Test: DeviceProfileDumpTest
Test: CalculatedHotseatSpecTest
Test: HotseatSpecsTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I5aa2891c4c68033a4dd28f84f9dd5478be17b1d8
2023-09-05 16:31:06 +01:00
Thales Lima
f8bfb036ba Create specs for hotseat
Some attributes of hotseat change depending on the size of the device. In the future more attributes could be moved to the spec, e.g. hotseat icons.

Fix: 292204436
Test: CalculatedHotseatSpecTest
Test: HotseatSpecsTest
Test: SizeSpecTest
Test: DeviceProfileResponsiveDumpTest
Test: DeviceProfileResponsiveAlternativeDisplaysDumpTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I6a4e05d75af819dbf1444a5ca45c2080f55dc203
2023-08-10 10:23:23 +00:00
Charlie Anderson
6702ed1e19 adding popup test files and allow for selecting activity to use
Test: manual
Bug: 289228540
Flag: N/A
Change-Id: Ie78cd39d5636d8737b80a809fb22328de574f0c0
2023-07-28 10:07:00 -04:00
Federico Baron
827001a1fa Add WidgetPicker screenshot tests
We need screenshot tests for widget picker to prevent unintended UI changes.

Bug: 268219507
Test: n/a
Change-Id: I405401f5c68bb73bcb7bbd097f507abb1d66ff7e
2023-06-27 17:20:11 -07:00
Thales Lima
196e44baec Create AllApps responsive spec
Copy the parser from WorkspaceSpec and modify to use AllApps attributes.

Bug: 284152932
Test: AllAppsSpecsTest
Test: CalculatedAllAppsSpecTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I9362e126c64cb1a1abdef61894b003f14701b8e3
2023-06-14 15:02:58 +01:00
Jordan Silva
7ae9e3a6f5 Add FolderSpec for responsive grid support
Adds responsive grid implementation for folders. It follows the same concept as WorkspaceSpecs, so we have a parser similar to WorkspaceSpecs for FolderSpecs.

Bug: 284155638
Flag: ENABLE_RESPONSIVE_WORKSPACE
Test: FolderSpecsTest
Test: CalculatedFolderSpecsTest
Change-Id: Iea6d7d88ef42d1273aed7cf2ed5b397035518a52
2023-06-13 15:01:39 +01:00
Jordan Silva
2b8556ce1a Adding match workspace to SizeSpec for responsive grid support
Added matchWorkspace property to support responsive grid implementation for AllApps and Folders. This property indicates whether the attribute value will be used from the workspace instead of defining a fixed value in the AllApps and Folders XML. The class was updated to be a data class and added a auxiliar constructor new make it more flexible for testing and to add other initializers to support AllApps and Folders.

Bug: 284155638
Flag: ENABLE_RESPONSIVE_WORKSPACE
Test: WorkspaceSpecsTest
Test: SizeSpecTest
Change-Id: I65b71e66be7b8236a1dee62b56a487b87881d991
2023-06-09 17:05:22 +00:00
Thales Lima
c98b7815c6 Calculate sizes for responsive grid
This shouldn't change anything in the grids, only calculate the sizes of the grid.

Bug: 277064708
Test: CalculatedWorkspaceSpecTest
Test: WorkspaceSpecsTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: Id1f90ef44f5b869113d063bad17589e7e88d1d20
2023-05-17 10:33:36 +00:00
Thales Lima
1a2d4bd6f4 Create an XML parser for WorkspaceSpecs
Extract DeviceProfileTest to Launcher3 so it can be used in other tests as well, and change name of previous base test to be more descriptive.

Bug: 241386436
Test: WorkspaceSpecsTest
Change-Id: I64613bb5a23c374ed15fb6d936192236a541ab9b
2023-02-08 11:20:14 +00:00
Sunny Goyal
62ea1f1cb7 Re-enabling testShortcutIconWithTheme
> Updating shortcut id incache the icon cache was the culprit

Bug: 260722220
Test: Verified locally
Change-Id: I0e6bc9b06d1b99e33cb9b1a248647d54bf47dea4
2023-01-04 13:05:42 -08:00
Sunny Goyal
ce4896cff5 Fixing shortcuts not getting theme icons
Bug: 238650110
Test: Updated ThemeIconsTest
Change-Id: I803cd6eefa4e393bf19901a44712622adac7f4b1
2022-11-28 09:48:50 -08:00
Pierre Barbier de Reuille
ab33b76dce Launcher changes to support dynamic coloring on static widgets.
Bug: 179783721
Test: By hand using the AppWidgetDynamicColors widget
Change-Id: I27863cac31f2f6c29f5a717ff8d4492325f936fb
2021-03-10 22:04:35 +00:00
Jon Miranda
1d7ed30dba Remove widgets that no longer fit the workspace in their current spans.
This can happen when display size changes.
We compare span sizes of widget in the db to the min sizes of the widget
in the current display size. If the widget can no longer fit in its existing
spans, we remove it.

Also update test widgets to have minWidth/minHeight of 1dp. This ensures that
the spanX, spanY, min* values remain consistent between different test devices.

Bug: 168818961
Change-Id: I723372e4582658f78b2f23ced9073cb77977a6b8
2020-09-30 16:19:21 -07:00
vadimt
476a511ca5 Not using Settings app as a source of shortcuts
Bug: 126587956
Change-Id: I13ef4298a8133ff5773eef8658a04094d5d154da
2019-04-11 10:58:03 -07:00
Winson Chung
1054d4e8f2 Revert "Revert "Adding support for hiding widgets from the widget tray and reconfiguring widgets""
This reverts commit f502e5faec.

Reason for revert: Reverting post-build

Change-Id: I09eb292dbbbe37ffaf3abc477aa2ddb5700093b8
2018-03-05 19:39:21 +00:00
Winson Chung
f502e5faec Revert "Adding support for hiding widgets from the widget tray and reconfiguring widgets"
This reverts commit b29a5fa55c.

Reason for revert: Temporary revert for build.

Change-Id: I58045ad1ce28d398a5216ba4fbbcdba1196942ec
2018-03-05 18:06:52 +00:00
Sunny Goyal
b29a5fa55c Adding support for hiding widgets from the widget tray and reconfiguring widgets
> Removing AppInfo target
> Switching between uninstall and setup based on the drag view

Bug: 63931362
Change-Id: Iccd6f965fa3d61992244a365efc242122292c0ca
2018-03-02 13:20:09 -08:00
Sunny Goyal
658058b960 Adding some widget addition flow tests
> Added two dummy widget providers: with config and without config
> Added tests for verify widget config flow

Change-Id: I4577f085abe8f8b82047b644c71cc9065358153a
2017-01-23 15:28:25 -08:00