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

Commit 39968ded authored by Lyn's avatar Lyn Committed by Lyn Han
Browse files

Fix footer-notif overlap after inline reply

Do not animate footer Y when showing IME so that after IME hides,
the footer appears at and continues animating from the correct Y.

Fixes: 327515087

Test: send inline reply
      => footer appears at correct Y with no notification overlap
         and continues animating Y with normal use:

      open shade, close shade, add delayed notif
      => footer Y animates fine

      clear last notif
      => footer hides fine

Change-Id: I2b062dc80cee9125df90f249087fb9cf1b41c18f
parent 4dc9b4af
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import com.android.systemui.statusbar.notification.ColorUpdateLogger;
import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor;
import com.android.systemui.statusbar.notification.row.FooterViewButton;
import com.android.systemui.statusbar.notification.row.StackScrollerDecorView;
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
import com.android.systemui.statusbar.notification.stack.ViewState;
import com.android.systemui.util.DrawableDumpKt;
@@ -428,6 +429,12 @@ public class FooterView extends StackScrollerDecorView {
         */
        public boolean hideContent;

        /**
         * When true, skip animating Y on the next #animateTo.
         * Once true, remains true until reset in #animateTo.
         */
        public boolean resetY = false;

        @Override
        public void copyFrom(ViewState viewState) {
            super.copyFrom(viewState);
@@ -444,5 +451,17 @@ public class FooterView extends StackScrollerDecorView {
                footerView.setContentVisibleAnimated(!hideContent);
            }
        }

        @Override
        public void animateTo(View child, AnimationProperties properties) {
            if (child instanceof FooterView) {
                // Must set animateY=false before super.animateTo, which checks for animateY
                if (resetY) {
                    properties.getAnimationFilter().animateY = false;
                    resetY = false;
                }
            }
            super.animateTo(child, properties);
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ public class AnimationFilter {
    public static final int NO_DELAY = -1;
    boolean animateAlpha;
    boolean animateX;
    boolean animateY;
    public boolean animateY;
    ArraySet<View> animateYViews = new ArraySet<>();
    boolean animateZ;
    boolean animateHeight;
+7 −0
Original line number Diff line number Diff line
@@ -1792,6 +1792,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private void updateImeInset(WindowInsets windowInsets) {
        mImeInset = windowInsets.getInsets(WindowInsets.Type.ime()).bottom;

        if (mFooterView != null && mFooterView.getViewState() != null) {
            // Do not animate footer Y when showing IME so that after IME hides, the footer
            // appears at the correct Y. Once resetY is true, it remains true (even when IME
            // hides, where mImeInset=0) until reset in FooterViewState#animateTo.
            ((FooterView.FooterViewState) mFooterView.getViewState()).resetY |= mImeInset > 0;
        }

        if (mForcedScroll != null) {
            updateForcedScroll();
        }