This change removes the widget education tip dialog, and the arrow
tip view. These are no longer needed now that taps are handled by
showing an add button.
Bug: 335318980
Test: `pm clear com.google.android.apps.nexuslauncher` and open widget
picker
Flag: ACONFIG com.android.launcher3.enable_widget_tap_to_add NEXTFOOD
Change-Id: I9b24a41604880f5f94939c02b94f1a9f6a6c83d5
WidgetCell will use the generated RemoteViews preview to display
previews in the widget picker. It will fallback to current preview
methods if not available.
Introduces WidgetManagerHelper.loadGeneratedPreviews as a utility
function. WidgetManagerHelper is passed into the constructor of
WidgetItem to avoid calling
context.getSystemService(AppWidgetManager.class) for each widget.
Bug: 308041327
Test: atest Launcher3Tests:GeneratedPreviewTest
Flag: ACONFIG com.android.launcher3.enable_generated_previews DEVELOPMENT
Change-Id: I37429057cda83a5321884ace2537038e050b9a58
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
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
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
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
Refactors AllAppsSpecs, FolderSpecs and WorkspaceSpecs initialization to use the same code to parse the xml with different map function. This CL improves the readability of the code and remove code duplication.
Fix: 286538013
Flag: ENABLE_RESPONSIVE_WORKSPACE
Test: AllAppsSpecsTes
Test: CalculatedAllAppsSpecTest
Test: CalculatedFolderSpecsTest
Test: CalculatedWorkspaceSpecTest
Test: FolderSpecsTest
Test: WorkspaceSpecsTest
Test: DeviceProfileResponsiveDumpTest
Test: DeviceProfileResponsiveAlternativeDisplaysDumpTest
Change-Id: Iec5863619399efd2e80f3db46b75c4d785e1656f
We need screenshot tests for widget picker to prevent unintended UI changes.
Bug: 268219507
Test: n/a
Change-Id: I405401f5c68bb73bcb7bbd097f507abb1d66ff7e
Copy the parser from WorkspaceSpec and modify to use AllApps attributes.
Bug: 284152932
Test: AllAppsSpecsTest
Test: CalculatedAllAppsSpecTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I9362e126c64cb1a1abdef61894b003f14701b8e3
Add maxSize attribute to SizeSpec to limit the cell size up to a max size when matchWorkspace is true. The same validation was added when using fixedSize, ofAvailableSpace and ofRemainderSpace, so they could have a maxSize as a threshold.
Bug: 284155638
Flag: ENABLE_RESPONSIVE_WORKSPACE
Test: SizeSpecTest
Test: WorkspaceSpecsTest
Change-Id: I113657c241e6618eb3e501243412d8c5626fc3d5
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
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
> Addition/removal of shortcus is already removed. This just
cleans up the unused code path
Bug: 275875209
Test: Updated tests
Flag: N/A
Change-Id: I8ab7f57b693f996920e50e8beecafcffab5167e9
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
It also adds an assets folder inside of Launcher3 tests.
It also fixes a bug in fullReorder.
Test: atest ReorderWidgets
Flag: none
Bug: 229292911
Change-Id: I7dadd42a3057d353326691163bb7db71a2e9dcc4
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
> Updating shortcut id incache the icon cache was the culprit
Bug: 260722220
Test: Verified locally
Change-Id: I0e6bc9b06d1b99e33cb9b1a248647d54bf47dea4
We do not add background animation when opening target is translucent
Added additional check to not animate background if launcher is not
closing (which is already a subset of all-targets-translucent)
Also removing reverse background animation from widgets, similar
to app-icons as it is never added for launcherNotClosing path
Bug: 242379946
Test: Added translucent activtiy and widget and verified manually
that the behavior does not change
Change-Id: Icda8007c0063295bf8431c00a0f0b665ecdef109
This code contains utility clases that can change the display
of a device and make it look like another device.
The function DisplayEmulator#emulate receives a DeviceEmulationData
a certain grid to emulate and a callback, everyting that happens
inside of the callback will happen when the device is being emulated
and can be used by other tests.
Example test:
package com.android.launcher3.deviceemulator;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import com.android.launcher3.deviceemulator.models.DeviceEmulationData;
import com.android.launcher3.ui.AbstractLauncherUiTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.concurrent.TimeUnit;
@MediumTest
@RunWith(AndroidJUnit4.class)
public class TestTest extends AbstractLauncherUiTest {
@Test
public void testEmulation() throws Exception {
String deviceCode = "pixel6pro";
DeviceEmulationData deviceData = DeviceEmulationData.getDevice(deviceCode);
String grid = "normal";
DisplayEmulator displayEmulator = new DisplayEmulator(mTargetContext);
displayEmulator.emulate(deviceData, grid, () ->{
TimeUnit.SECONDS.sleep(10);
return true;
});
}
}
Test: You could use the test above to make your device look like a
Pixel6 pro for 10 secons.
Fix: 229028257
Change-Id: Icd79be405a2e14dda0bc5f555b0e46149e16f912
This reverts commit 455ba62b5d.
Reason for revert: Breaks tests on all targets
Bug: 196825541
Bug: 197570389
Change-Id: Ida6792a09c54dee46105b6b914a0dd1545bdf48d
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
Removing a separate table for workspace screens. List of screens are
automatically parsed using the items in the favorites DB. Order of the
screen based on the screen id and rearranging screens is no longer
supported. In case the screens need to be rearranged, all the items
in the favorites db will need to be updated with new screen ids.
This makes backing up the DB (in the same database) easier as only
one table needs to be duplicates.
Change-Id: I8ba947a898f637d780e2f49925e78604263126e8
> Removing AppInfo target
> Switching between uninstall and setup based on the drag view
Bug: 63931362
Change-Id: Iccd6f965fa3d61992244a365efc242122292c0ca
Adding a schema file for handling DB downgrade. This schema file is part of
the backup/restore set, and hence is available on a device with lower app version.
Bug: 37257575
Change-Id: I69c8ef5f28d5209be6e6679412c7459d4eeda5d0