diff --git a/GITHUB_CHANGELOG.md b/GITHUB_CHANGELOG.md index 33b3c3e799..bba41c0713 100644 --- a/GITHUB_CHANGELOG.md +++ b/GITHUB_CHANGELOG.md @@ -28,6 +28,7 @@ Compatibility list: * [Lawnchair] Reimplement Favorite application label * [Lawnchair] Hotseat positioning with favorite icon label enabled placed the same even if label is disabled * [Lawnchair] Hotseat background now have a reasonably sized margin compared to D2 +* [Lawnchair] Qsb sizing now correctly estimate the width based on workspace ### Development 2 diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 2b25551462..3c4a9e816e 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -67,6 +67,7 @@ import com.android.launcher3.responsive.ResponsiveCellSpecsProvider; import com.android.launcher3.responsive.ResponsiveSpec.Companion.ResponsiveSpecType; import com.android.launcher3.responsive.ResponsiveSpec.DimensionType; import com.android.launcher3.responsive.ResponsiveSpecsProvider; +import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.util.CellContentDimensions; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController.Info; @@ -434,6 +435,17 @@ public class DeviceProfile { && inv.hotseatSpecsId != INVALID_RESOURCE_HANDLE && inv.workspaceCellSpecsId != INVALID_RESOURCE_HANDLE && inv.allAppsCellSpecsId != INVALID_RESOURCE_HANDLE; + + Log.d("LC-DP", + String.valueOf(inv.workspaceSpecsId != ResourceUtils.INVALID_RESOURCE_HANDLE)); + Log.d("LC-DP", String.valueOf(inv.allAppsSpecsId != ResourceUtils.INVALID_RESOURCE_HANDLE)); + Log.d("LC-DP", String.valueOf(inv.folderSpecsId != ResourceUtils.INVALID_RESOURCE_HANDLE)); + Log.d("LC-DP", String.valueOf(inv.hotseatSpecsId != ResourceUtils.INVALID_RESOURCE_HANDLE)); + Log.d("LC-DP", + String.valueOf(inv.workspaceCellSpecsId != ResourceUtils.INVALID_RESOURCE_HANDLE)); + Log.d("LC-DP", + String.valueOf(inv.allAppsCellSpecsId != ResourceUtils.INVALID_RESOURCE_HANDLE)); + Log.d("LC-DP", String.valueOf(inv.workspaceSpecsId)); mIsScalableGrid = inv.isScalable && !isVerticalBarLayout() && !isMultiWindowMode; // Determine device posture. @@ -1032,9 +1044,6 @@ public class DeviceProfile { hotseatQsbSpace += isLabelInDock ? (iconTextHeight / 2) : 0; int space = Math.abs(hotseatCellHeightPx / 2) - 16; - if (!isLabelInDock) { - space -= iconTextHeight; - } hotseatBarBottomSpacePx *= PreferenceExtensionsKt .firstBlocking(preferenceManager2.getHotseatBottomFactor()); diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 81d746b661..a5c1baa5ce 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -367,7 +367,16 @@ public class Hotseat extends CellLayout implements Insettable { super.onMeasure(widthMeasureSpec, heightMeasureSpec); DeviceProfile dp = mActivity.getDeviceProfile(); - mQsb.measure(MeasureSpec.makeMeasureSpec(dp.hotseatQsbWidth, MeasureSpec.EXACTLY), + + // LC: Fix weird sizing with hotseatQsbWidth being 0 on phone + int width; + if (dp.isQsbInline) { + width = dp.hotseatQsbWidth; + } else { + width = getShortcutsAndWidgets().getMeasuredWidth(); + } + + mQsb.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(dp.hotseatQsbHeight, MeasureSpec.EXACTLY)); }