Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c50c326c authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Fix image crossfade animation of left icon in groups.

Bug: 181048615
Test: manual; expand/collapse grouped and big picture notifs
Change-Id: Ie1b3d4cfd1485799546600c91b20d1625ecf4eb4
parent 138403ad
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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);
        }
    }
}
+15 −8
Original line number Diff line number Diff line
@@ -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