commit | 97e2f471994132e869f0897128673056a3eed1c3 | [log] [tgz] |
---|---|---|
author | TreeHugger Robot <treehugger-gerrit@google.com> | Tue May 24 18:08:11 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue May 24 18:08:11 2022 +0000 |
tree | 35146dfcbaa11410dd4e14e962287aafb8a9e88f | |
parent | f05363a7d4c98763032c125deb5a552c22018375 [diff] | |
parent | ec3723beb1f02ad665c6c8f030eebe81cf1daf33 [diff] |
Merge "Fix widget span" into tm-dev am: ec3723beb1 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18579283 Change-Id: I4d8be05de0358c94d2f401db6bd7b579d4a2aca2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java index 1bcba14..8962c4f 100644 --- a/src/com/android/launcher3/widget/BaseWidgetSheet.java +++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java
@@ -198,7 +198,9 @@ /** Returns the number of cells that can fit horizontally in a given {@code content}. */ protected int computeMaxHorizontalSpans(View content, int contentHorizontalPaddingPx) { DeviceProfile deviceProfile = mActivityContext.getDeviceProfile(); - int availableWidth = content.getMeasuredWidth() - contentHorizontalPaddingPx; + int availableWidth = content.getMeasuredWidth() + - contentHorizontalPaddingPx + - (2 * mContentHorizontalMarginInPx); Point cellSize = deviceProfile.getCellSize(); if (cellSize.x > 0) { return availableWidth / cellSize.x;