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

Commit d278fda7 authored by Jeff DeCew's avatar Jeff DeCew Committed by Automerger Merge Worker
Browse files

Merge "Revert "Remove NOTIFICATION_INLINE_REPLY_ANIMATION flag"" into udc-dev...

Merge "Revert "Remove NOTIFICATION_INLINE_REPLY_ANIMATION flag"" into udc-dev am: a6730b0a am: eae28751

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23135141



Change-Id: I9f975e540cd2d563f561172c318fa1bf16ab1835
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6d6440c1 eae28751
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -79,6 +79,11 @@ object Flags {
    // TODO(b/257315550): Tracking Bug
    val NO_HUN_FOR_OLD_WHEN = releasedFlag(118, "no_hun_for_old_when")

    // TODO(b/260335638): Tracking Bug
    @JvmField
    val NOTIFICATION_INLINE_REPLY_ANIMATION =
        unreleasedFlag(174148361, "notification_inline_reply_animation")

    /** Makes sure notification panel is updated before the user switch is complete. */
    // TODO(b/278873737): Tracking Bug
    @JvmField
+8 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.statusbar.notification.collection.inflation;

import static com.android.systemui.flags.Flags.NOTIFICATION_INLINE_REPLY_ANIMATION;
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_CONTRACTED;
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_EXPANDED;
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_PUBLIC;
@@ -30,6 +31,7 @@ import android.view.ViewGroup;

import com.android.internal.util.NotificationMessagingUtil;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationPresenter;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
@@ -71,6 +73,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
    private NotificationListContainer mListContainer;
    private BindRowCallback mBindRowCallback;
    private NotificationClicker mNotificationClicker;
    private FeatureFlags mFeatureFlags;

    @Inject
    public NotificationRowBinderImpl(
@@ -82,7 +85,8 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
            RowContentBindStage rowContentBindStage,
            Provider<RowInflaterTask> rowInflaterTaskProvider,
            ExpandableNotificationRowComponent.Builder expandableNotificationRowComponentBuilder,
            IconManager iconManager) {
            IconManager iconManager,
            FeatureFlags featureFlags) {
        mContext = context;
        mNotifBindPipeline = notifBindPipeline;
        mRowContentBindStage = rowContentBindStage;
@@ -92,6 +96,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
        mRowInflaterTaskProvider = rowInflaterTaskProvider;
        mExpandableNotificationRowComponentBuilder = expandableNotificationRowComponentBuilder;
        mIconManager = iconManager;
        mFeatureFlags = featureFlags;
    }

    /**
@@ -175,6 +180,8 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
        entry.setRow(row);
        mNotifBindPipeline.manageRow(entry, row);
        mBindRowCallback.onBindRow(row);
        row.setInlineReplyAnimationFlagEnabled(
                mFeatureFlags.isEnabled(NOTIFICATION_INLINE_REPLY_ANIMATION));
    }

    /**
+10 −1
Original line number Diff line number Diff line
@@ -271,6 +271,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private OnExpandClickListener mOnExpandClickListener;
    private View.OnClickListener mOnFeedbackClickListener;
    private Path mExpandingClipPath;
    private boolean mIsInlineReplyAnimationFlagEnabled = false;

    // Listener will be called when receiving a long click event.
    // Use #setLongPressPosition to optionally assign positional data with the long press.
@@ -3054,6 +3055,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        return showingLayout != null && showingLayout.requireRowToHaveOverlappingRendering();
    }

    public void setInlineReplyAnimationFlagEnabled(boolean isEnabled) {
        mIsInlineReplyAnimationFlagEnabled = isEnabled;
    }

    @Override
    public void setActualHeight(int height, boolean notifyListeners) {
        boolean changed = height != getActualHeight();
@@ -3073,7 +3078,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        }
        int contentHeight = Math.max(getMinHeight(), height);
        for (NotificationContentView l : mLayouts) {
            if (mIsInlineReplyAnimationFlagEnabled) {
                l.setContentHeight(height);
            } else {
                l.setContentHeight(contentHeight);
            }
        }
        if (mIsSummaryWithChildren) {
            mChildrenContainer.setActualHeight(height);
+2 −1
Original line number Diff line number Diff line
@@ -635,7 +635,8 @@ public class NotificationContentView extends FrameLayout implements Notification
        int hint;
        if (mHeadsUpChild != null && isVisibleOrTransitioning(VISIBLE_TYPE_HEADSUP)) {
            hint = getViewHeight(VISIBLE_TYPE_HEADSUP);
            if (mHeadsUpRemoteInput != null && mHeadsUpRemoteInput.isAnimatingAppearance()) {
            if (mHeadsUpRemoteInput != null && mHeadsUpRemoteInput.isAnimatingAppearance()
                    && mHeadsUpRemoteInputController.isFocusAnimationFlagActive()) {
                // While the RemoteInputView is animating its appearance, it should be allowed
                // to overlap the hint, therefore no space is reserved for the hint during the
                // appearance animation of the RemoteInputView
+48 −14
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.view.WindowInsetsAnimation.Callback.DISPATCH_MODE_STOP;
import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_STANDARD;

import android.app.ActivityManager;
import android.app.Notification;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
@@ -134,6 +135,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
    @Nullable
    private RevealParams mRevealParams;
    private Rect mContentBackgroundBounds;
    private boolean mIsFocusAnimationFlagActive;
    private boolean mIsAnimatingAppearance = false;

    // TODO(b/193539698): move these to a Controller
@@ -431,7 +433,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        // case to prevent flicker.
        if (!mRemoved) {
            ViewGroup parent = (ViewGroup) getParent();
            if (animate && parent != null) {
            if (animate && parent != null && mIsFocusAnimationFlagActive) {

                ViewGroup grandParent = (ViewGroup) parent.getParent();
                ViewGroupOverlay overlay = parent.getOverlay();
@@ -595,11 +597,25 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        mEditText.setText(editTextContent);
    }

    /**
     * Sets whether the feature flag for the revised inline reply animation is active or not.
     * @param active
     */
    public void setIsFocusAnimationFlagActive(boolean active) {
        mIsFocusAnimationFlagActive = active;
    }

    /**
     * Focuses the RemoteInputView and animates its appearance
     */
    public void focusAnimated() {
        if (getVisibility() != VISIBLE) {
        if (!mIsFocusAnimationFlagActive && getVisibility() != VISIBLE
                && mRevealParams != null) {
            android.animation.Animator animator = mRevealParams.createCircularRevealAnimator(this);
            animator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
            animator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
            animator.start();
        } else if (mIsFocusAnimationFlagActive && getVisibility() != VISIBLE) {
            mIsAnimatingAppearance = true;
            setAlpha(0f);
            Animator focusAnimator = getFocusAnimator(getActionsContainerLayout());
@@ -654,6 +670,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
    }

    private void reset() {
        if (mIsFocusAnimationFlagActive) {
            mProgressBar.setVisibility(INVISIBLE);
            mResetting = true;
            mSending = false;
@@ -667,6 +684,23 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
                setAttachment(null);
                mResetting = false;
            });
            return;
        }

        mResetting = true;
        mSending = false;
        mEntry.remoteInputTextWhenReset = SpannedString.valueOf(mEditText.getText());

        mEditText.getText().clear();
        mEditText.setEnabled(isAggregatedVisible());
        mSendButton.setVisibility(VISIBLE);
        mProgressBar.setVisibility(INVISIBLE);
        mController.removeSpinning(mEntry.getKey(), mToken);
        updateSendButton();
        onDefocus(false /* animate */, false /* logClose */, null /* doAfterDefocus */);
        setAttachment(null);

        mResetting = false;
    }

    @Override
@@ -810,7 +844,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);
        setPivotY(getMeasuredHeight());
        if (mIsFocusAnimationFlagActive) setPivotY(getMeasuredHeight());
        if (mContentBackgroundBounds != null) {
            mContentBackground.setBounds(mContentBackgroundBounds);
        }
Loading