Implement calculations of Responsive Grid for AllApps
All Apps follow the same sizes as the workspace, so we copy the measurements to AllApps values.
Bug: 284152932
Test: HomeScreenAllAppsImageTest
Test: DeviceProfileDumpTest
Test: HomeScreenResponsiveAllAppsImageTest
Test: DeviceProfileResponsiveDumpTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I12743a6ac5ab5f1a8bc911511bdc7e12b2261d86
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 7eb085a..81aa2b2 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -179,6 +179,8 @@
public int devicePaddingId = INVALID_RESOURCE_HANDLE;
@XmlRes
public int workspaceSpecsId = INVALID_RESOURCE_HANDLE;
+ @XmlRes
+ public int allAppsSpecsId = INVALID_RESOURCE_HANDLE;
public String dbFile;
public int defaultLayoutId;
@@ -353,6 +355,7 @@
isScalable = closestProfile.isScalable;
devicePaddingId = closestProfile.devicePaddingId;
workspaceSpecsId = closestProfile.mWorkspaceSpecsId;
+ allAppsSpecsId = closestProfile.mAllAppsSpecsId;
this.deviceType = deviceType;
inlineNavButtonsEndSpacing = closestProfile.inlineNavButtonsEndSpacing;
@@ -799,6 +802,7 @@
private final boolean isScalable;
private final int devicePaddingId;
private final int mWorkspaceSpecsId;
+ private final int mAllAppsSpecsId;
public GridOption(Context context, AttributeSet attrs) {
TypedArray a = context.obtainStyledAttributes(
@@ -863,8 +867,11 @@
if (FeatureFlags.ENABLE_RESPONSIVE_WORKSPACE.get()) {
mWorkspaceSpecsId = a.getResourceId(
R.styleable.GridDisplayOption_workspaceSpecsId, INVALID_RESOURCE_HANDLE);
+ mAllAppsSpecsId = a.getResourceId(
+ R.styleable.GridDisplayOption_allAppsSpecsId, INVALID_RESOURCE_HANDLE);
} else {
mWorkspaceSpecsId = INVALID_RESOURCE_HANDLE;
+ mAllAppsSpecsId = INVALID_RESOURCE_HANDLE;
}
int inlineForRotation = a.getInt(R.styleable.GridDisplayOption_inlineQsb,