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

Commit 1558bfa6 authored by Shan Huang's avatar Shan Huang Committed by Android (Google) Code Review
Browse files

Merge changes Iea484773,Id2cb41f7 into main

* changes:
  Fix RemoteInputView background color for transparency.
  Switch from group background to children backgrounds when group expansion finishes.
parents 0df428e7 8ec4c7d9
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.Rect;
@@ -3997,12 +3998,18 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            }
        } else if (isChildInGroup()) {
            final int childColor = getShowingLayout().getBackgroundColorForExpansionState();
            // Only show a background if the group is expanded OR if it is expanding / collapsing
            // and has a custom background color.
            if (Flags.notificationRowTransparency() && childColor == Color.TRANSPARENT) {
                // If child is not customizing its background color, switch from the parent to
                // the child background when the expansion finishes.
                mShowNoBackground = !mNotificationParent.mShowNoBackground;
            } else {
                // Only show a background if the group is expanded OR if it is
                // expanding / collapsing and has a custom background color.
                final boolean showBackground = isGroupExpanded()
                        || ((mNotificationParent.isGroupExpansionChanging()
                        || mNotificationParent.isUserLocked()) && childColor != 0);
                mShowNoBackground = !showBackground;
            }
        } else {
            // Only children or parents ever need no background.
            mShowNoBackground = false;
+16 −8
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ import com.android.internal.logging.UiEvent;
import com.android.internal.logging.UiEventLogger;
import com.android.internal.util.ContrastColorUtil;
import com.android.systemui.Dependency;
import com.android.systemui.Flags;
import com.android.systemui.res.R;
import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -245,8 +246,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        mProgressBar.setProgressTintList(accentColor);
        mProgressBar.setIndeterminateTintList(accentColor);
        mProgressBar.setSecondaryProgressTintList(accentColor);
        if (!Flags.notificationRowTransparency()) {
            setBackgroundColor(backgroundColor);
        }
    }

    @Override
    protected void onFinishInflate() {
@@ -419,10 +422,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        // case to prevent flicker.
        if (!mRemoved) {
            ViewGroup parent = (ViewGroup) getParent();
            View actionsContainer = getActionsContainerLayout();
            if (animate && parent != null) {

                ViewGroup grandParent = (ViewGroup) parent.getParent();
                View actionsContainer = getActionsContainerLayout();
                int actionsContainerHeight =
                        actionsContainer != null ? actionsContainer.getHeight() : 0;

@@ -459,6 +462,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
                if (mWrapper != null) {
                    mWrapper.setRemoteInputVisible(false);
                }
                if (Flags.notificationRowTransparency()) {
                    if (actionsContainer != null) actionsContainer.setAlpha(1);
                }
            }
        }
        unregisterBackCallback();
@@ -823,12 +829,14 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
                    ObjectAnimator.ofFloat(fadeOutView, View.ALPHA, 1f, 0f);
            fadeOutViewAlphaAnimator.setDuration(FOCUS_ANIMATION_CROSSFADE_DURATION);
            fadeOutViewAlphaAnimator.setInterpolator(InterpolatorsAndroidX.LINEAR);
            if (!Flags.notificationRowTransparency()) {
                animatorSet.addListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation, boolean isReverse) {
                        fadeOutView.setAlpha(1f);
                    }
                });
            }
            animatorSet.playTogether(alphaAnimator, scaleAnimator, fadeOutViewAlphaAnimator);
        }
        return animatorSet;