summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java15
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java6
2 files changed, 11 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index eee8ddb84d76..618e67615867 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -205,7 +205,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
private boolean mAnimateNextTopPaddingChange;
private int mBottomPadding;
@VisibleForTesting
- int mBottomInset = 0;
+ // mImeInset=0 when IME is hidden
+ int mImeInset = 0;
private float mQsExpansionFraction;
private final int mSplitShadeMinContentHeight;
private String mLastUpdateSidePaddingDumpString;
@@ -396,7 +397,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
@Override
public WindowInsets onProgress(WindowInsets windowInsets,
List<WindowInsetsAnimation> list) {
- updateBottomInset(windowInsets);
+ updateImeInset(windowInsets);
return windowInsets;
}
@@ -1788,8 +1789,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
+ ((!isExpanded() && isPinnedHeadsUp(v)) ? mHeadsUpInset : getTopPadding());
}
- private void updateBottomInset(WindowInsets windowInsets) {
- mBottomInset = windowInsets.getInsets(WindowInsets.Type.ime()).bottom;
+ private void updateImeInset(WindowInsets windowInsets) {
+ mImeInset = windowInsets.getInsets(WindowInsets.Type.ime()).bottom;
if (mForcedScroll != null) {
updateForcedScroll();
@@ -1810,7 +1811,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
}
if (!mIsInsetAnimationRunning) {
// update bottom inset e.g. after rotation
- updateBottomInset(insets);
+ updateImeInset(insets);
}
return insets;
}
@@ -2214,9 +2215,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
private int getImeInset() {
// The NotificationStackScrollLayout does not extend all the way to the bottom of the
- // display. Therefore, subtract that space from the mBottomInset, in order to only include
+ // display. Therefore, subtract that space from the mImeInset, in order to only include
// the portion of the bottom inset that actually overlaps the NotificationStackScrollLayout.
- return Math.max(0, mBottomInset
+ return Math.max(0, mImeInset
- (getRootView().getHeight() - getHeight() - getLocationOnScreen()[1]));
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
index 13df09134b23..abb9432425bc 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
@@ -931,14 +931,14 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
@Test
public void testWindowInsetAnimationProgress_updatesBottomInset() {
- int bottomImeInset = 100;
+ int imeInset = 100;
WindowInsets windowInsets = new WindowInsets.Builder()
- .setInsets(ime(), Insets.of(0, 0, 0, bottomImeInset)).build();
+ .setInsets(ime(), Insets.of(0, 0, 0, imeInset)).build();
ArrayList<WindowInsetsAnimation> windowInsetsAnimations = new ArrayList<>();
mStackScrollerInternal
.dispatchWindowInsetsAnimationProgress(windowInsets, windowInsetsAnimations);
- assertEquals(bottomImeInset, mStackScrollerInternal.mBottomInset);
+ assertEquals(imeInset, mStackScrollerInternal.mImeInset);
}
@Test