From 2e8074a574ab22f935a76afcd4204cfe69a9c64b Mon Sep 17 00:00:00 2001 From: Lyn Han Date: Tue, 20 Jul 2021 23:02:15 -0500 Subject: [PATCH] Fix HUN input alignment with IME SSA#updateHeadsUpStates defines the top HUN as having mustStayOnScreen = TRUE headsUpIsVisible = FALSE However, SSA#updateChild sets headsUpIsVisible = TRUE for the top HUN when shade is closed When we tap the reply button and show IME, SSA#updateHeadsUpStates does not recognize the top HUN as such and skips it when reducing yTranslation by scrollY (which includes IME inset) This change skips setting headsUpIsVisible on HUNs when shade is closed. Fixes: 187485733 Test: expand HUN in portrait/landscape with largest font/display tap reply button to show IME => HUN shifts up to align bottom of input with top of IME Change-Id: I236b01a7f9070ebe58457eab9ea8072703acb12c --- .../statusbar/notification/stack/StackScrollAlgorithm.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java index 23e3742c2bdfb..d0507e1e136ca 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java @@ -394,7 +394,8 @@ public class StackScrollAlgorithm { ambientState.getExpansionFraction(), true /* notification */); } - if (view.mustStayOnScreen() && viewState.yTranslation >= 0) { + if (ambientState.isShadeExpanded() && view.mustStayOnScreen() + && viewState.yTranslation >= 0) { // Even if we're not scrolled away we're in view and we're also not in the // shelf. We can relax the constraints and let us scroll off the top! float end = viewState.yTranslation + viewState.height + ambientState.getStackY();