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

Commit 8ec4c7d9 authored by Shan Huang's avatar Shan Huang
Browse files

Fix RemoteInputView background color for transparency.

Flag: com.android.systemui.notification_row_transparency
Bug: 392190433
Fixes: 392190433
Test: Create colorized and non colorized notifications. Click reply. Make sure colors look correct.

Change-Id: Iea48477348a2fccef872b441a838c34c012cda6b
parent 8a6c9425
Loading
Loading
Loading
Loading
+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;