Merge "Encapsulate background width updates to ActivatableNotificationView" into tm-dev

This commit is contained in:
Lyn Han
2022-03-16 17:46:59 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 7 deletions

View File

@@ -226,10 +226,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
? MathUtils.lerp(shortestWidth, getWidth(), fractionToShade) ? MathUtils.lerp(shortestWidth, getWidth(), fractionToShade)
: getWidth(); : getWidth();
ActivatableNotificationView anv = (ActivatableNotificationView) this; ActivatableNotificationView anv = (ActivatableNotificationView) this;
NotificationBackgroundView bg = anv.getBackgroundNormal(); anv.setBackgroundWidth((int) actualWidth);
if (bg != null) {
anv.getBackgroundNormal().setActualWidth((int) actualWidth);
}
if (mShelfIcons != null) { if (mShelfIcons != null) {
mShelfIcons.setActualLayoutWidth((int) actualWidth); mShelfIcons.setActualLayoutWidth((int) actualWidth);
} }

View File

@@ -163,10 +163,13 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
} }
/** /**
* @return The background of this view. * @param width The actual width to apply to the background view.
*/ */
public NotificationBackgroundView getBackgroundNormal() { public void setBackgroundWidth(int width) {
return mBackgroundNormal; if (mBackgroundNormal == null) {
return;
}
mBackgroundNormal.setActualWidth(width);
} }
@Override @Override