From c50c326cc44d442788f88bfae294dac8186e5045 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Thu, 4 Mar 2021 11:23:56 -0500 Subject: Fix image crossfade animation of left icon in groups. Bug: 181048615 Test: manual; expand/collapse grouped and big picture notifs Change-Id: Ie1b3d4cfd1485799546600c91b20d1625ecf4eb4 --- .../NotificationBigPictureTemplateViewWrapper.java | 7 ++++--- .../wrapper/NotificationTemplateViewWrapper.java | 23 ++++++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationBigPictureTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationBigPictureTemplateViewWrapper.java index 7248bcef621c..151840afcef1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationBigPictureTemplateViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationBigPictureTemplateViewWrapper.java @@ -44,9 +44,10 @@ public class NotificationBigPictureTemplateViewWrapper extends NotificationTempl private void updateImageTag(StatusBarNotification notification) { final Bundle extras = notification.getNotification().extras; - Icon overRiddenIcon = extras.getParcelable(Notification.EXTRA_LARGE_ICON_BIG); - if (overRiddenIcon != null) { - mPicture.setTag(ImageTransformState.ICON_TAG, overRiddenIcon); + Icon overriddenIcon = extras.getParcelable(Notification.EXTRA_LARGE_ICON_BIG); + if (overriddenIcon != null) { + mRightIcon.setTag(ImageTransformState.ICON_TAG, overriddenIcon); + mLeftIcon.setTag(ImageTransformState.ICON_TAG, overriddenIcon); } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java index e9934c0053b0..e0b58125aabd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java @@ -51,7 +51,8 @@ import com.android.systemui.statusbar.notification.row.HybridNotificationView; public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapper { private final int mFullHeaderTranslation; - protected ImageView mPicture; + protected ImageView mRightIcon; + protected ImageView mLeftIcon; private ProgressBar mProgressBar; private TextView mTitle; private TextView mText; @@ -140,9 +141,14 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp } private void resolveTemplateViews(StatusBarNotification notification) { - mPicture = mView.findViewById(com.android.internal.R.id.right_icon); - if (mPicture != null) { - mPicture.setTag(ImageTransformState.ICON_TAG, + mRightIcon = mView.findViewById(com.android.internal.R.id.right_icon); + if (mRightIcon != null) { + mRightIcon.setTag(ImageTransformState.ICON_TAG, + notification.getNotification().getLargeIcon()); + } + mLeftIcon = mView.findViewById(com.android.internal.R.id.left_icon); + if (mLeftIcon != null) { + mLeftIcon.setTag(ImageTransformState.ICON_TAG, notification.getNotification().getLargeIcon()); } mTitle = mView.findViewById(com.android.internal.R.id.title); @@ -240,9 +246,9 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp resolveTemplateViews(row.getEntry().getSbn()); super.onContentUpdated(row); // With the modern templates, a large icon visually overlaps the header, so we can't - // simply hide the header -- just show the + // hide the header, we must show it. mCanHideHeader = mNotificationHeader != null - && (mPicture == null || mPicture.getVisibility() != VISIBLE); + && (mRightIcon == null || mRightIcon.getVisibility() != VISIBLE); if (row.getHeaderVisibleAmount() != DEFAULT_HEADER_VISIBLE_AMOUNT) { setHeaderVisibleAmount(row.getHeaderVisibleAmount()); } @@ -260,14 +266,15 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp mTransformationHelper.addTransformedView(TransformableView.TRANSFORMING_VIEW_TEXT, mText); } - if (mPicture != null) { + if (mRightIcon != null) { mTransformationHelper.addTransformedView(TransformableView.TRANSFORMING_VIEW_IMAGE, - mPicture); + mRightIcon); } if (mProgressBar != null) { mTransformationHelper.addTransformedView(TransformableView.TRANSFORMING_VIEW_PROGRESS, mProgressBar); } + addViewsTransformingToSimilar(mLeftIcon); } @Override -- cgit v1.2.3-59-g8ed1b