mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Merge "Improvements for All Apps on different display sizes" into tm-qpr-dev
This commit is contained in:
@@ -404,6 +404,7 @@ public class DeviceProfile {
|
||||
allAppsBorderSpacePx = new Point(
|
||||
pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].x, mMetrics),
|
||||
pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].y, mMetrics));
|
||||
setupAllAppsStyle(context);
|
||||
|
||||
workspacePageIndicatorHeight = res.getDimensionPixelSize(
|
||||
R.dimen.workspace_page_indicator_height);
|
||||
@@ -810,9 +811,6 @@ public class DeviceProfile {
|
||||
int cellLayoutHorizontalPadding =
|
||||
(cellLayoutPaddingPx.left + cellLayoutPaddingPx.right) / 2;
|
||||
if (isTablet) {
|
||||
allAppsLeftRightPadding =
|
||||
res.getDimensionPixelSize(R.dimen.all_apps_bottom_sheet_horizontal_padding);
|
||||
|
||||
int usedWidth = (allAppsCellWidthPx * numShownAllAppsColumns)
|
||||
+ (allAppsBorderSpacePx.x * (numShownAllAppsColumns - 1))
|
||||
+ allAppsLeftRightPadding * 2;
|
||||
@@ -823,6 +821,20 @@ public class DeviceProfile {
|
||||
}
|
||||
}
|
||||
|
||||
private void setupAllAppsStyle(Context context) {
|
||||
TypedArray allAppsStyle;
|
||||
if (inv.allAppsStyle != INVALID_RESOURCE_HANDLE) {
|
||||
allAppsStyle = context.obtainStyledAttributes(inv.allAppsStyle,
|
||||
R.styleable.AllAppsStyle);
|
||||
} else {
|
||||
allAppsStyle = context.obtainStyledAttributes(R.style.AllAppsStyleDefault,
|
||||
R.styleable.AllAppsStyle);
|
||||
}
|
||||
allAppsLeftRightPadding = allAppsStyle.getDimensionPixelSize(
|
||||
R.styleable.AllAppsStyle_horizontalPadding, 0);
|
||||
allAppsStyle.recycle();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of extra (or unused) vertical space.
|
||||
*/
|
||||
@@ -1806,7 +1818,7 @@ public class DeviceProfile {
|
||||
* Set the viewScaleProvider for the builder
|
||||
*
|
||||
* @param viewScaleProvider The viewScaleProvider to be set for the
|
||||
* DeviceProfile
|
||||
* DeviceProfile
|
||||
* @return This builder
|
||||
*/
|
||||
@NonNull
|
||||
|
||||
@@ -175,6 +175,7 @@ public class InvariantDeviceProfile {
|
||||
*/
|
||||
public int numAllAppsColumns;
|
||||
public int numDatabaseAllAppsColumns;
|
||||
public @StyleRes int allAppsStyle;
|
||||
|
||||
/**
|
||||
* Do not query directly. see {@link DeviceProfile#isScalableGrid}.
|
||||
@@ -384,6 +385,8 @@ public class InvariantDeviceProfile {
|
||||
hotseatBarBottomSpace = displayOption.hotseatBarBottomSpace;
|
||||
hotseatQsbSpace = displayOption.hotseatQsbSpace;
|
||||
|
||||
allAppsStyle = closestProfile.allAppsStyle;
|
||||
|
||||
numAllAppsColumns = closestProfile.numAllAppsColumns;
|
||||
numDatabaseAllAppsColumns = deviceType == TYPE_MULTI_DISPLAY
|
||||
? closestProfile.numDatabaseAllAppsColumns : closestProfile.numAllAppsColumns;
|
||||
@@ -789,6 +792,7 @@ public class InvariantDeviceProfile {
|
||||
private final @StyleRes int folderStyle;
|
||||
private final @StyleRes int cellStyle;
|
||||
|
||||
private final @StyleRes int allAppsStyle;
|
||||
private final int numAllAppsColumns;
|
||||
private final int numDatabaseAllAppsColumns;
|
||||
private final int numHotseatIcons;
|
||||
@@ -824,6 +828,8 @@ public class InvariantDeviceProfile {
|
||||
demoModeLayoutId = a.getResourceId(
|
||||
R.styleable.GridDisplayOption_demoModeLayoutId, defaultLayoutId);
|
||||
|
||||
allAppsStyle = a.getResourceId(R.styleable.GridDisplayOption_allAppsStyle,
|
||||
R.style.AllAppsStyleDefault);
|
||||
numAllAppsColumns = a.getInt(
|
||||
R.styleable.GridDisplayOption_numAllAppsColumns, numColumns);
|
||||
numDatabaseAllAppsColumns = a.getInt(
|
||||
|
||||
Reference in New Issue
Block a user