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

Commit 37645b41 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Update summarization appearance

- Max 2/3 lines instead of 1/2
- Italic text instead of bold
- extra space between icon and text

Test: ConversationNotificationProcessorTest
Test: manual
Flag: android.app.nm_summarization_ui
Bug: 390217880
Change-Id: I20d3b7fe83b039b0ac277c1080138995921a304c
parent b86c4a61
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ public class ConversationLayout extends FrameLayout
    public static final Interpolator FAST_OUT_LINEAR_IN = new PathInterpolator(0.4f, 0f, 1f, 1f);
    public static final Interpolator FAST_OUT_SLOW_IN = new PathInterpolator(0.4f, 0f, 0.2f, 1f);
    public static final Interpolator OVERSHOOT = new PathInterpolator(0.4f, 0f, 0.2f, 1.4f);
    private static final int MAX_SUMMARIZATION_LINES = 3;
    public static final int IMPORTANCE_ANIM_GROW_DURATION = 250;
    public static final int IMPORTANCE_ANIM_SHRINK_DURATION = 200;
    public static final int IMPORTANCE_ANIM_SHRINK_DELAY = 25;
@@ -401,7 +402,7 @@ public class ConversationLayout extends FrameLayout
    public void setIsCollapsed(boolean isCollapsed) {
        mIsCollapsed = isCollapsed;
        mMessagingLinearLayout.setMaxDisplayedLines(isCollapsed
                ? TextUtils.isEmpty(mSummarizedContent) ? 1 : 2
                ? TextUtils.isEmpty(mSummarizedContent) ? 1 : MAX_SUMMARIZATION_LINES
                : Integer.MAX_VALUE);
        updateExpandButton();
        updateContentEndPaddings();
+2 −1
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ public class MessagingLayout extends FrameLayout
    public static final Interpolator LINEAR_OUT_SLOW_IN = new PathInterpolator(0f, 0f, 0.2f, 1f);
    public static final Interpolator FAST_OUT_LINEAR_IN = new PathInterpolator(0.4f, 0f, 1f, 1f);
    public static final Interpolator FAST_OUT_SLOW_IN = new PathInterpolator(0.4f, 0f, 0.2f, 1f);
    private static final int MAX_SUMMARIZATION_LINES = 3;
    public static final OnLayoutChangeListener MESSAGING_PROPERTY_ANIMATOR
            = new MessagingPropertyAnimator();
    private final PeopleHelper mPeopleHelper = new PeopleHelper();
@@ -222,7 +223,7 @@ public class MessagingLayout extends FrameLayout
        List<MessagingMessage> newMessagingMessages;
        mSummarizedContent = extras.getCharSequence(Notification.EXTRA_SUMMARIZED_CONTENT);
        if (!TextUtils.isEmpty(mSummarizedContent) && mIsCollapsed) {
            mMessagingLinearLayout.setMaxDisplayedLines(2);
            mMessagingLinearLayout.setMaxDisplayedLines(MAX_SUMMARIZATION_LINES);
            Notification.MessagingStyle.Message summary =
                    new Notification.MessagingStyle.Message(mSummarizedContent,  0, "");
            newMessagingMessages = createMessages(List.of(summary), false, usePrecomputedText);
+2 −2
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ class ConversationNotificationProcessorTest : SysuiTestCase() {
        assertThat(
                checkSpans.getSpans(
                    /* queryStart = */ 0,
                    /* queryEnd = */ 1,
                    /* queryEnd = */ 2,
                    /* kind = */ ImageSpan::class.java,
                )
            )
+4 −4
Original line number Diff line number Diff line
@@ -100,9 +100,9 @@ constructor(
                    )
                    entry.ranking.summarization?.let {
                        setSpan(
                            /* what = */ StyleSpan(Typeface.BOLD),
                            /* start = */ 1,
                            /* end = */ it.length,
                            /* what = */ StyleSpan(Typeface.ITALIC),
                            /* start = */ 2,
                            /* end = */ it.length + 2,
                            /* flags = */ Spanned.SPAN_EXCLUSIVE_INCLUSIVE,
                        )
                    }
+1 −1
Original line number Diff line number Diff line
@@ -2204,7 +2204,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
                    R.dimen.notification_min_height);
        }
        mMaxSmallHeightWithSummarization = NotificationUtils.getFontScaledHeight(mContext,
                com.android.internal.R.dimen.notification_min_height);
                com.android.internal.R.dimen.notification_collapsed_height_with_summarization);
        mMaxExpandedHeight = NotificationUtils.getFontScaledHeight(mContext,
                R.dimen.notification_max_height);
        mMaxExpandedHeightForPromotedOngoing = NotificationUtils.getFontScaledHeight(mContext,
Loading