From b9dccf5a7745c82ba67dbade82bcce57cb026062 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Mon, 8 Mar 2021 16:21:02 -0500 Subject: Let CallStyle notifications be any height. This separate dimension was really a bug waiting to happen. Add a little padding here or there, forget to update this dimension, and suddenly in rare cases the UI would be cropped. Bug: 179178086 Test: Post CallStyle notifications with title, text, progress, smart actions. Change-Id: I35500885eb53750fa2ccde4f2f602e6cfdb02113 --- packages/SystemUI/res/values/dimens.xml | 4 ---- .../statusbar/notification/row/ExpandableNotificationRow.java | 5 +---- .../notification/row/wrapper/NotificationCallTemplateViewWrapper.kt | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index ea0ea5e9472a..4f63b3784342 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -167,10 +167,6 @@ and the notification won't use this much, but is measured with wrap_content --> 196dp - - 172dp - 1500dp diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 0f23b770aacd..cde9f38d0074 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -166,7 +166,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView private int mMaxSmallHeightLarge; private int mMaxSmallHeightMedia; private int mMaxExpandedHeight; - private int mMaxCallHeight; private int mIncreasedPaddingBetweenElements; private int mNotificationLaunchHeight; private boolean mMustStayOnScreen; @@ -687,7 +686,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView // them a headerless design, then remove this hack. smallHeight = mMaxSmallHeightLarge; } else if (isCallLayout) { - smallHeight = mMaxCallHeight; + smallHeight = mMaxExpandedHeight; } else if (mUseIncreasedCollapsedHeight && layout == mPrivateLayout) { smallHeight = mMaxSmallHeightLarge; } else { @@ -1621,8 +1620,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView R.dimen.notification_min_height_media); mMaxExpandedHeight = NotificationUtils.getFontScaledHeight(mContext, R.dimen.notification_max_height); - mMaxCallHeight = NotificationUtils.getFontScaledHeight(mContext, - R.dimen.call_notification_full_height); mMaxHeadsUpHeightBeforeN = NotificationUtils.getFontScaledHeight(mContext, R.dimen.notification_max_heads_up_height_legacy); mMaxHeadsUpHeightBeforeP = NotificationUtils.getFontScaledHeight(mContext, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCallTemplateViewWrapper.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCallTemplateViewWrapper.kt index 4541ebf4c4f2..12e94cbc1ab9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCallTemplateViewWrapper.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCallTemplateViewWrapper.kt @@ -34,7 +34,7 @@ class NotificationCallTemplateViewWrapper constructor( ) : NotificationTemplateViewWrapper(ctx, view, row) { private val minHeightWithActions: Int = - NotificationUtils.getFontScaledHeight(ctx, R.dimen.call_notification_full_height) + NotificationUtils.getFontScaledHeight(ctx, R.dimen.notification_max_height) private val callLayout: CallLayout = view as CallLayout private lateinit var conversationIconView: CachingIconView -- cgit v1.2.3-59-g8ed1b