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

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

Change-Id: I7565a49fd8479ab3608377e3a5099bfc118f0bc6
This commit is contained in:
Lyn Han
2022-03-16 17:55:49 +00:00
committed by Automerger Merge Worker
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)
: getWidth();
ActivatableNotificationView anv = (ActivatableNotificationView) this;
NotificationBackgroundView bg = anv.getBackgroundNormal();
if (bg != null) {
anv.getBackgroundNormal().setActualWidth((int) actualWidth);
}
anv.setBackgroundWidth((int) actualWidth);
if (mShelfIcons != null) {
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() {
return mBackgroundNormal;
public void setBackgroundWidth(int width) {
if (mBackgroundNormal == null) {
return;
}
mBackgroundNormal.setActualWidth(width);
}
@Override