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

Commit 9c1d6bab authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I73f54855,I69d3a7c7,I32141ecf

* changes:
  Fixed an issue where the notification wouldn't go away
  Fixed an issue where the action bar below wasn't rounded
  Improved the experience when sending multiple messages
parents db26bf12 90d11a16
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou
    private boolean mFirstLayout;
    private boolean mIsHidingAnimated;
    private boolean mNeedsGeneratedAvatar;
    private Notification.Person mSender;

    public MessagingGroup(@NonNull Context context) {
        super(context);
@@ -89,6 +90,7 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou
    }

    public void setSender(Notification.Person sender) {
        mSender = sender;
        mSenderName.setText(sender.getName());
        mNeedsGeneratedAvatar = sender.getIcon() == null;
        if (!mNeedsGeneratedAvatar) {
@@ -355,7 +357,7 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou
        return 0;
    }

    public View getSender() {
    public View getSenderView() {
        return mSenderName;
    }

@@ -370,4 +372,8 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou
    public boolean needsGeneratedAvatar() {
        return mNeedsGeneratedAvatar;
    }

    public Notification.Person getSender() {
        return mSender;
    }
}
+25 −4
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import android.util.ArrayMap;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.RemotableViewMethod;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.animation.Interpolator;
import android.view.animation.PathInterpolator;
@@ -135,9 +134,24 @@ public class MessagingLayout extends FrameLayout {
        if (headerText != null) {
            mConversationTitle = headerText.getText();
        }
        addRemoteInputHistoryToMessages(newMessages,
                extras.getCharSequenceArray(Notification.EXTRA_REMOTE_INPUT_HISTORY));
        bind(newMessages, newHistoricMessages);
    }

    private void addRemoteInputHistoryToMessages(
            List<Notification.MessagingStyle.Message> newMessages,
            CharSequence[] remoteInputHistory) {
        if (remoteInputHistory == null || remoteInputHistory.length == 0) {
            return;
        }
        for (int i = remoteInputHistory.length - 1; i >= 0; i--) {
            CharSequence message = remoteInputHistory[i];
            newMessages.add(new Notification.MessagingStyle.Message(
                    message, 0, (Notification.Person) null));
        }
    }

    private void bind(List<Notification.MessagingStyle.Message> newMessages,
            List<Notification.MessagingStyle.Message> newHistoricMessages) {

@@ -189,9 +203,10 @@ public class MessagingLayout extends FrameLayout {
        for (int i = 0; i < mGroups.size(); i++) {
            // Let's now set the avatars
            MessagingGroup group = mGroups.get(i);
            boolean isOwnMessage = group.getSender() == mUser;
            CharSequence senderName = group.getSenderName();
            if (!group.needsGeneratedAvatar() || TextUtils.isEmpty(senderName)
                    || (mIsOneToOne && mLargeIcon != null)) {
                    || (mIsOneToOne && mLargeIcon != null && !isOwnMessage)) {
                continue;
            }
            String symbol = uniqueNames.get(senderName);
@@ -209,7 +224,7 @@ public class MessagingLayout extends FrameLayout {
            if (!group.needsGeneratedAvatar() || TextUtils.isEmpty(senderName)) {
                continue;
            }
            if (mIsOneToOne && mLargeIcon != null) {
            if (mIsOneToOne && mLargeIcon != null && group.getSender() != mUser) {
                group.setAvatar(mLargeIcon);
            } else {
                Icon cachedIcon = cachedAvatars.get(senderName);
@@ -271,6 +286,12 @@ public class MessagingLayout extends FrameLayout {

    public void setUser(Notification.Person user) {
        mUser = user;
        if (mUser.getIcon() == null) {
            Icon userIcon = Icon.createWithResource(getContext(),
                    com.android.internal.R.drawable.messaging_user);
            userIcon.setTint(mLayoutColor);
            mUser.setIcon(userIcon);
        }
    }

    private void addMessagesToGroups(List<MessagingMessage> historicMessages,
@@ -410,7 +431,7 @@ public class MessagingLayout extends FrameLayout {
                            continue;
                        }
                        MessagingPropertyAnimator.fadeIn(group.getAvatar());
                        MessagingPropertyAnimator.fadeIn(group.getSender());
                        MessagingPropertyAnimator.fadeIn(group.getSenderView());
                        MessagingPropertyAnimator.startLocalTranslationFrom(group,
                                group.getHeight(), LINEAR_OUT_SLOW_IN);
                    }
+28 −0
Original line number Diff line number Diff line
<!--
Copyright (C) 2014 The Android Open Source Project

   Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportHeight="192.0"
        android:viewportWidth="192.0">
    <path android:fillColor="#000000"
          android:fillAlpha="0.125"
          android:pathData="M96,0C43.01,0 0,43.01 0,96s43.01,96 96,96s96,-43.01 96,-96S148.99,0 96,0z"/>
    <path android:fillColor="#BDBDBD"
          android:pathData="M96,85.09c13.28,0 24,-10.72 24,-24c0,-13.28 -10.72,-24 -24,-24s-24,10.72 -24,24C72,74.37 82.72,85.09 96,85.09z"/>
    <path android:fillColor="#BDBDBD"
          android:pathData="M96,99.27c-29.33,0 -52.36,14.18 -52.36,27.27c11.09,17.06 30.51,28.36 52.36,28.36s41.27,-11.3 52.36,-28.36C148.36,113.45 125.33,99.27 96,99.27z"/>
</vector>
+1 −0
Original line number Diff line number Diff line
@@ -3204,6 +3204,7 @@

  <java-symbol type="string" name="global_action_logout" />
  <java-symbol type="string" name="config_mainBuiltInDisplayCutout" />
  <java-symbol type="drawable" name="messaging_user" />
  <java-symbol type="bool" name="config_fillMainBuiltInDisplayCutout" />
  <java-symbol type="drawable" name="ic_logout" />

+3 −1
Original line number Diff line number Diff line
@@ -2377,7 +2377,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            NotificationContentView contentView = (NotificationContentView) child;
            if (isClippingNeeded()) {
                return true;
            } else if (!hasNoRounding() && contentView.shouldClipToRounding()) {
            } else if (!hasNoRounding()
                    && contentView.shouldClipToRounding(getCurrentTopRoundness() != 0.0f,
                    getCurrentBottomRoundness() != 0.0f)) {
                return true;
            }
        } else if (child == mChildrenContainer) {
Loading