Merge "Use the current padding instead of the default one during layout." into sc-dev am: f45161efa1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15173051

Change-Id: I003d7a49ff079175ef6752430691557970fd0029
This commit is contained in:
TreeHugger Robot
2021-07-01 22:37:01 +00:00
committed by Automerger Merge Worker

View File

@@ -282,11 +282,10 @@ public class AppWidgetHostView extends FrameLayout {
}
private SizeF computeSizeFromLayout(int left, int top, int right, int bottom) {
Rect padding = getDefaultPadding();
float density = getResources().getDisplayMetrics().density;
return new SizeF(
(right - left - padding.right - padding.left) / density,
(bottom - top - padding.bottom - padding.top) / density
(right - left - getPaddingLeft() - getPaddingRight()) / density,
(bottom - top - getPaddingTop() - getPaddingBottom()) / density
);
}
@@ -386,7 +385,7 @@ public class AppWidgetHostView extends FrameLayout {
maxHeight = Math.max(maxHeight, paddedSize.getHeight());
}
if (paddedSizes.equals(
widgetManager.getAppWidgetOptions(mAppWidgetId).<PointF>getParcelableArrayList(
widgetManager.getAppWidgetOptions(mAppWidgetId).<SizeF>getParcelableArrayList(
AppWidgetManager.OPTION_APPWIDGET_SIZES))) {
return;
}