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

Commit 9d0334cb authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Update summarization appearance" into main

parents ca1d4453 37645b41
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
@@ -63,6 +63,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();
@@ -223,7 +224,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,
                        )
                    }
+5 −1
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import java.util.Objects;
 */
public class HybridConversationNotificationView extends HybridNotificationView {

    private static final int MAX_SUMMARIZATION_LINES = 2;
    private ImageView mConversationIconView;
    private TextView mConversationSenderName;
    private ViewStub mConversationFacePileStub;
@@ -292,11 +293,14 @@ public class HybridConversationNotificationView extends HybridNotificationView {
            @Nullable CharSequence summarization
    ) {
        if (AsyncHybridViewInflation.isUnexpectedlyInLegacyMode()) return;
        if (summarization != null) {
        if (!TextUtils.isEmpty(summarization)) {
            mConversationSenderName.setVisibility(GONE);
            titleText = null;
            contentText = summarization;
            mTextView.setSingleLine(false);
            mTextView.setMaxLines(MAX_SUMMARIZATION_LINES);
        } else {
            mTextView.setSingleLine(true);
            if (conversationSenderName == null) {
                mConversationSenderName.setVisibility(GONE);
            } else {