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

Commit a2b1d375 authored by Selim Cinek's avatar Selim Cinek
Browse files

Added back the recently alerted indicator to conversations

Previously this was dropped, it's now reintroduced.

Fixes: 150905003
Test: atest SystemUITests
Change-Id: Ia152bc4117fa9c656b3d477ef8e50708e1056148
parent 4237e827
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ public class NotificationHeaderView extends ViewGroup {
    private CachingIconView mIcon;
    private View mProfileBadge;
    private View mAppOps;
    private View mAudiblyAlertedIcon;
    private boolean mExpanded;
    private boolean mShowExpandButtonAtEnd;
    private boolean mShowWorkBadgeAtEnd;
@@ -119,7 +118,6 @@ public class NotificationHeaderView extends ViewGroup {
        mIcon = findViewById(com.android.internal.R.id.icon);
        mProfileBadge = findViewById(com.android.internal.R.id.profile_badge);
        mAppOps = findViewById(com.android.internal.R.id.app_ops);
        mAudiblyAlertedIcon = findViewById(com.android.internal.R.id.alerted_icon);
    }

    @Override
@@ -318,11 +316,6 @@ public class NotificationHeaderView extends ViewGroup {
        updateExpandButton();
    }

    /** Updates icon visibility based on the noisiness of the notification. */
    public void setRecentlyAudiblyAlerted(boolean audiblyAlerted) {
        mAudiblyAlertedIcon.setVisibility(audiblyAlerted ? View.VISIBLE : View.GONE);
    }

    private void updateExpandButton() {
        int drawableId;
        int contentDescriptionId;
+12 −0
Original line number Diff line number Diff line
@@ -166,6 +166,18 @@
                        android:visibility="gone"
                    />

                    <ImageView
                        android:id="@+id/alerted_icon"
                        android:layout_width="@dimen/notification_alerted_size"
                        android:layout_height="@dimen/notification_alerted_size"
                        android:layout_gravity="center"
                        android:layout_marginStart="4dp"
                        android:paddingTop="2dp"
                        android:scaleType="fitCenter"
                        android:visibility="gone"
                        android:contentDescription="@string/notification_alerted_content_description"
                        android:src="@drawable/ic_notifications_alerted"/>

                    <ImageView
                        android:id="@+id/profile_badge"
                        android:layout_width="@dimen/notification_badge_size"
+2 −2
Original line number Diff line number Diff line
@@ -1697,8 +1697,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private final Runnable mExpireRecentlyAlertedFlag = () -> applyAudiblyAlertedRecently(false);

    private void applyAudiblyAlertedRecently(boolean audiblyAlertedRecently) {
        if (mIsSummaryWithChildren && mChildrenContainer.getHeaderView() != null) {
            mChildrenContainer.getHeaderView().setRecentlyAudiblyAlerted(audiblyAlertedRecently);
        if (mIsSummaryWithChildren) {
            mChildrenContainer.setRecentlyAudiblyAlerted(audiblyAlertedRecently);
        }
        mPrivateLayout.setRecentlyAudiblyAlerted(audiblyAlertedRecently);
        mPublicLayout.setRecentlyAudiblyAlerted(audiblyAlertedRecently);
+6 −6
Original line number Diff line number Diff line
@@ -1481,14 +1481,14 @@ public class NotificationContentView extends FrameLayout {

    /** Sets whether the notification being displayed audibly alerted the user. */
    public void setRecentlyAudiblyAlerted(boolean audiblyAlerted) {
        if (mContractedChild != null && mContractedWrapper.getNotificationHeader() != null) {
            mContractedWrapper.getNotificationHeader().setRecentlyAudiblyAlerted(audiblyAlerted);
        if (mContractedChild != null) {
            mContractedWrapper.setRecentlyAudiblyAlerted(audiblyAlerted);
        }
        if (mExpandedChild != null && mExpandedWrapper.getNotificationHeader() != null) {
            mExpandedWrapper.getNotificationHeader().setRecentlyAudiblyAlerted(audiblyAlerted);
        if (mExpandedChild != null) {
            mExpandedWrapper.setRecentlyAudiblyAlerted(audiblyAlerted);
        }
        if (mHeadsUpChild != null && mHeadsUpWrapper.getNotificationHeader() != null) {
            mHeadsUpWrapper.getNotificationHeader().setRecentlyAudiblyAlerted(audiblyAlerted);
        if (mHeadsUpChild != null) {
            mHeadsUpWrapper.setRecentlyAudiblyAlerted(audiblyAlerted);
        }
    }

+12 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
    private View mMicIcon;
    private View mOverlayIcon;
    private View mAppOps;
    private View mAudiblyAlertedIcon;

    private boolean mIsLowPriority;
    private boolean mTransformLowPriorityTitle;
@@ -117,6 +118,7 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
        mMicIcon = mView.findViewById(com.android.internal.R.id.mic);
        mOverlayIcon = mView.findViewById(com.android.internal.R.id.overlay);
        mAppOps = mView.findViewById(com.android.internal.R.id.app_ops);
        mAudiblyAlertedIcon = mView.findViewById(com.android.internal.R.id.alerted_icon);
        if (mNotificationHeader != null) {
            mNotificationHeader.setShowExpandButtonAtEnd(mShowExpandButtonAtEnd);
            mColor = mNotificationHeader.getOriginalIconColor();
@@ -230,6 +232,9 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
        if (mOverlayIcon != null) {
            mTransformationHelper.addViewTransformingToSimilar(mOverlayIcon);
        }
        if (mAudiblyAlertedIcon != null) {
            mTransformationHelper.addViewTransformingToSimilar(mAudiblyAlertedIcon);
        }
    }

    @Override
@@ -240,6 +245,13 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
        }
    }

    @Override
    public void setRecentlyAudiblyAlerted(boolean audiblyAlerted) {
        if (mAudiblyAlertedIcon != null) {
            mAudiblyAlertedIcon.setVisibility(audiblyAlerted ? View.VISIBLE : View.GONE);
        }
    }

    @Override
    public NotificationHeaderView getNotificationHeader() {
        return mNotificationHeader;
Loading