From 410c75a44276302d3ce1513cf09eba58a3d7bb88 Mon Sep 17 00:00:00 2001 From: Luca Zuccarini Date: Mon, 14 Feb 2022 13:12:05 +0000 Subject: [PATCH] Ensure that the Hotseat respects the margins of the QSB. Before this change they were ignored by onMeasure(), so that the QSB couldn't rely on margins for its positioning. Bug: 217477426 Test: manual Change-Id: Ifecd3d40ea584273b7857d19b25a90dbafe1c656 --- src/com/android/launcher3/Hotseat.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index cb0cc113b0..e1680fc7e7 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -173,9 +173,15 @@ public class Hotseat extends CellLayout implements Insettable { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); - int width = mActivity.getDeviceProfile().isQsbInline - ? mActivity.getDeviceProfile().qsbWidth - : getShortcutsAndWidgets().getMeasuredWidth(); + int width; + if (mActivity.getDeviceProfile().isQsbInline) { + width = mActivity.getDeviceProfile().qsbWidth; + } else { + MarginLayoutParams qsbParams = (MarginLayoutParams) mQsb.getLayoutParams(); + width = getShortcutsAndWidgets().getMeasuredWidth() + - qsbParams.getMarginStart() + - qsbParams.getMarginEnd(); + } mQsb.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(mQsbHeight, MeasureSpec.EXACTLY));