Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +8 −7 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; } Loading Loading @@ -1792,8 +1793,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(); Loading @@ -1814,7 +1815,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } if (!mIsInsetAnimationRunning) { // update bottom inset e.g. after rotation updateBottomInset(insets); updateImeInset(insets); } return insets; } Loading Loading @@ -2218,9 +2219,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])); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +8 −7 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; } Loading Loading @@ -1792,8 +1793,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(); Loading @@ -1814,7 +1815,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } if (!mIsInsetAnimationRunning) { // update bottom inset e.g. after rotation updateBottomInset(insets); updateImeInset(insets); } return insets; } Loading Loading @@ -2218,9 +2219,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])); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -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 Loading