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

Commit efcfa073 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Clean up NOTIFICATION_INLINE_REPLY_ANIMATION flag

Fix: 260335638
Test: atest SystemUITests
Flag: LEGACY NOTIFICATION_INLINE_REPLY_ANIMATION ENABLED
Change-Id: If852320af78edbb5f5323207bf57f4965652ba3f
parent 33493216
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -76,10 +76,6 @@ object Flags {
    val NOTIFICATION_MEMORY_LOGGING_ENABLED =
            releasedFlag("notification_memory_logging_enabled")

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

    // TODO(b/288326013): Tracking Bug
    @JvmField
    val NOTIFICATION_ASYNC_HYBRID_VIEW_INFLATION =
+1 −8
Original line number Diff line number Diff line
@@ -278,8 +278,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private OnExpandClickListener mOnExpandClickListener;
    private View.OnClickListener mOnFeedbackClickListener;
    private Path mExpandingClipPath;
    private final RefactorFlag mInlineReplyAnimation =
            RefactorFlag.forView(Flags.NOTIFICATION_INLINE_REPLY_ANIMATION);

    private static boolean shouldSimulateSlowMeasure() {
        return Compile.IS_DEBUG && RefactorFlag.forView(
@@ -3241,13 +3239,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            mGuts.setActualHeight(height);
            return;
        }
        int contentHeight = Math.max(getMinHeight(), height);
        for (NotificationContentView l : mLayouts) {
            if (mInlineReplyAnimation.isEnabled()) {
            l.setContentHeight(height);
            } else {
                l.setContentHeight(contentHeight);
            }
        }
        if (mIsSummaryWithChildren) {
            mChildrenContainer.setActualHeight(height);
+1 −2
Original line number Diff line number Diff line
@@ -699,8 +699,7 @@ 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()
                    && mHeadsUpRemoteInputController.isFocusAnimationFlagActive()) {
            if (mHeadsUpRemoteInput != null && mHeadsUpRemoteInput.isAnimatingAppearance()) {
                // 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
+16 −50
Original line number Diff line number Diff line
@@ -135,7 +135,6 @@ 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
@@ -432,7 +431,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        // case to prevent flicker.
        if (!mRemoved) {
            ViewGroup parent = (ViewGroup) getParent();
            if (animate && parent != null && mIsFocusAnimationFlagActive) {
            if (animate && parent != null) {

                ViewGroup grandParent = (ViewGroup) parent.getParent();
                View actionsContainer = getActionsContainerLayout();
@@ -497,8 +496,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
    }

    private void setTopMargin(int topMargin) {
        if (!(getLayoutParams() instanceof FrameLayout.LayoutParams)) return;
        final FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) getLayoutParams();
        if (!(getLayoutParams() instanceof FrameLayout.LayoutParams layoutParams)) return;
        layoutParams.topMargin = topMargin;
        setLayoutParams(layoutParams);
    }
@@ -607,25 +605,11 @@ 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 (!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) {
        if (getVisibility() != VISIBLE) {
            mIsAnimatingAppearance = true;
            setAlpha(0f);
            Animator focusAnimator = getFocusAnimator(getActionsContainerLayout());
@@ -680,7 +664,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
    }

    private void reset() {
        if (mIsFocusAnimationFlagActive) {
        mProgressBar.setVisibility(INVISIBLE);
        mResetting = true;
        mSending = false;
@@ -694,23 +677,6 @@ 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
@@ -854,7 +820,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);
        if (mIsFocusAnimationFlagActive) setPivotY(getMeasuredHeight());
        setPivotY(getMeasuredHeight());
        if (mContentBackgroundBounds != null) {
            mContentBackground.setBounds(mContentBackgroundBounds);
        }
@@ -1015,9 +981,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene

        private RemoteInputView mRemoteInputView;
        boolean mShowImeOnInputConnection;
        private LightBarController mLightBarController;
        private final LightBarController mLightBarController;
        private InputMethodManager mInputMethodManager;
        private ArraySet<String> mSupportedMimes = new ArraySet<>();
        private final ArraySet<String> mSupportedMimes = new ArraySet<>();
        UserHandle mUser;

        public RemoteEditText(Context context, AttributeSet attrs) {
+0 −7
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.view.View
import com.android.internal.logging.UiEventLogger
import com.android.systemui.res.R
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags.NOTIFICATION_INLINE_REPLY_ANIMATION
import com.android.systemui.statusbar.NotificationRemoteInputManager
import com.android.systemui.statusbar.RemoteInputController
import com.android.systemui.statusbar.notification.collection.NotificationEntry
@@ -64,8 +63,6 @@ interface RemoteInputViewController {

    var revealParams: RevealParams?

    val isFocusAnimationFlagActive: Boolean

    /**
     * Sets the smart reply that should be inserted in the remote input, or `null` if the user is
     * not editing a smart reply.
@@ -155,9 +152,6 @@ class RemoteInputViewControllerImpl @Inject constructor(

    override val isActive: Boolean get() = view.isActive

    override val isFocusAnimationFlagActive: Boolean
        get() = mFlags.isEnabled(NOTIFICATION_INLINE_REPLY_ANIMATION)

    override fun bind() {
        if (isBound) return
        isBound = true
@@ -168,7 +162,6 @@ class RemoteInputViewControllerImpl @Inject constructor(
            view.setSupportedMimeTypes(it.allowedDataTypes)
        }
        view.setRevealParameters(revealParams)
        view.setIsFocusAnimationFlagActive(isFocusAnimationFlagActive)

        view.addOnEditTextFocusChangedListener(onFocusChangeListener)
        view.addOnSendRemoteInputListener(onSendRemoteInputListener)
Loading