summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2018-06-13 18:23:45 -0700
committer Selim Cinek <cinek@google.com> 2018-06-15 10:35:03 -0700
commitf4b04ae0bb9a24faaaadb21c7e1c89e78a540fd0 (patch)
tree925db118ade41cc2692c64e89a123ac8786d314b
parentd54c3a3036430043e6408a6d5de3a09885fdf474 (diff)
Fixed an issue where the contentHeight was wrong
The content height was using the regular topPadding which factored in the darkAmount, but wasn't updating the contentHeight. Since updating the contentHeight is pretty expensive, we are now using the regular topPadding whenever the lock screen isn't fully dark, which will make sure that everything is properly positioned and not faded. Change-Id: Ida9f29443efc1eb80924b0e755ea5338adfe23f7 Fixes: 110091926 Test: adb shell setprop debug.force_no_blanking true and observe proper layout after animations
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index 9c26c69045d5..ccb0de4efd47 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -2041,11 +2041,9 @@ public class NotificationStackScrollLayout extends ViewGroup
}
private int getScrollRange() {
- int contentHeight = getContentHeight();
- int scrollRange = Math.max(0, contentHeight - mMaxLayoutHeight);
+ int scrollRange = Math.max(0, mContentHeight - mMaxLayoutHeight);
int imeInset = getImeInset();
- scrollRange += Math.min(imeInset, Math.max(0,
- getContentHeight() - (getHeight() - imeInset)));
+ scrollRange += Math.min(imeInset, Math.max(0, mContentHeight - (getHeight() - imeInset)));
return scrollRange;
}
@@ -2146,10 +2144,6 @@ public class NotificationStackScrollLayout extends ViewGroup
return count;
}
- public int getContentHeight() {
- return mContentHeight;
- }
-
private void updateContentHeight() {
int height = 0;
float previousPaddingRequest = mPaddingBetweenElements;
@@ -2213,7 +2207,11 @@ public class NotificationStackScrollLayout extends ViewGroup
}
}
mIntrinsicContentHeight = height;
- mContentHeight = height + mTopPadding + mBottomMargin;
+
+ // We don't want to use the toppadding since that might be interpolated and we want
+ // to take the final value of the animation.
+ int topPadding = mAmbientState.isFullyDark() ? mDarkTopPadding : mRegularTopPadding;
+ mContentHeight = height + topPadding + mBottomMargin;
updateScrollability();
clampScrollPosition();
mAmbientState.setLayoutMaxHeight(mContentHeight);