Merge "Apply layout param to NotificationShelf only when needed" into tm-qpr-dev

This commit is contained in:
TreeHugger Robot
2022-11-15 19:49:36 +00:00
committed by Android (Google) Code Review

View File

@@ -132,8 +132,11 @@ public class NotificationShelf extends ActivatableNotificationView implements
mPaddingBetweenElements = res.getDimensionPixelSize(R.dimen.notification_divider_height);
ViewGroup.LayoutParams layoutParams = getLayoutParams();
layoutParams.height = res.getDimensionPixelOffset(R.dimen.notification_shelf_height);
setLayoutParams(layoutParams);
final int newShelfHeight = res.getDimensionPixelOffset(R.dimen.notification_shelf_height);
if (newShelfHeight != layoutParams.height) {
layoutParams.height = newShelfHeight;
setLayoutParams(layoutParams);
}
final int padding = res.getDimensionPixelOffset(R.dimen.shelf_icon_container_padding);
mShelfIcons.setPadding(padding, 0, padding, 0);