summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2014-05-12 19:32:28 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2014-05-12 19:32:28 +0000
commitbea8b51e18c7a0eea5078be905ed8adc09d99076 (patch)
tree5c3054c9f510ce68bf6b3e9e6119fdd884f66e46
parent28f5225443f72f7e46982f3fe22dd55e19ae4fac (diff)
parenta5eaa6034dd48fab0f5a232c09ebed35f359963e (diff)
Merge "Improved stack scroll range logic and more card background bug"
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationOverflowContainer.java15
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java32
3 files changed, 22 insertions, 27 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
index 281bd2d47a07..4bd0e1cf8d45 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
@@ -112,7 +112,7 @@ public abstract class ExpandableView extends FrameLayout {
* @return The desired notification height.
*/
public int getIntrinsicHeight() {
- return mActualHeight;
+ return getHeight();
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationOverflowContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationOverflowContainer.java
index 864c5976993e..451c5c560171 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationOverflowContainer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationOverflowContainer.java
@@ -34,21 +34,6 @@ public class NotificationOverflowContainer extends ActivatableNotificationView {
}
@Override
- public void setActualHeight(int currentHeight, boolean notifyListeners) {
- // noop
- }
-
- @Override
- public int getActualHeight() {
- return getHeight();
- }
-
- @Override
- public void setClipTopAmount(int clipTopAmount) {
- // noop
- }
-
- @Override
protected void onFinishInflate() {
super.onFinishInflate();
mIconsView = (NotificationOverflowIconsView) findViewById(R.id.overflow_icons_view);
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 27f661992cb1..5849afbfad8a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -80,9 +80,12 @@ public class NotificationStackScrollLayout extends ViewGroup
private Paint mDebugPaint;
private int mContentHeight;
private int mCollapsedSize;
+ private int mBottomStackSlowDownHeight;
private int mBottomStackPeekSize;
private int mEmptyMarginBottom;
private int mPaddingBetweenElements;
+ private int mPaddingBetweenElementsDimmed;
+ private int mPaddingBetweenElementsNormal;
private int mTopPadding;
/**
@@ -154,7 +157,7 @@ public class NotificationStackScrollLayout extends ViewGroup
int y = mCollapsedSize;
canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
y = (int) (getLayoutHeight() - mBottomStackPeekSize
- - mStackScrollAlgorithm.getBottomStackSlowDownLength());
+ - mBottomStackSlowDownHeight);
canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
y = (int) (getLayoutHeight() - mBottomStackPeekSize);
canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
@@ -186,9 +189,20 @@ public class NotificationStackScrollLayout extends ViewGroup
.getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
mEmptyMarginBottom = context.getResources().getDimensionPixelSize(
R.dimen.notification_stack_margin_bottom);
- mPaddingBetweenElements = context.getResources()
- .getDimensionPixelSize(R.dimen.notification_padding);
mStackScrollAlgorithm = new StackScrollAlgorithm(context);
+ mPaddingBetweenElementsDimmed = context.getResources()
+ .getDimensionPixelSize(R.dimen.notification_padding_dimmed);
+ mPaddingBetweenElementsNormal = context.getResources()
+ .getDimensionPixelSize(R.dimen.notification_padding);
+ updatePadding(false);
+ }
+
+ private void updatePadding(boolean dimmed) {
+ mPaddingBetweenElements = dimmed
+ ? mPaddingBetweenElementsDimmed
+ : mPaddingBetweenElementsNormal;
+ mBottomStackSlowDownHeight = mStackScrollAlgorithm.getBottomStackSlowDownLength();
+ updateContentHeight();
}
@Override
@@ -742,15 +756,10 @@ public class NotificationStackScrollLayout extends ViewGroup
if (firstChild != null) {
int contentHeight = getContentHeight();
int firstChildMaxExpandHeight = getMaxExpandHeight(firstChild);
-
- scrollRange = Math.max(0, contentHeight - mMaxLayoutHeight + mBottomStackPeekSize);
+ scrollRange = Math.max(0, contentHeight - mMaxLayoutHeight + mBottomStackPeekSize
+ + mBottomStackSlowDownHeight);
if (scrollRange > 0) {
View lastChild = getLastChildNotGone();
- if (isViewExpanded(lastChild)) {
- // last child is expanded, so we have to ensure that it can exit the
- // bottom stack
- scrollRange += mCollapsedSize + mPaddingBetweenElements;
- }
// We want to at least be able collapse the first item and not ending in a weird
// end state.
scrollRange = Math.max(scrollRange, firstChildMaxExpandHeight - mCollapsedSize);
@@ -1184,7 +1193,7 @@ public class NotificationStackScrollLayout extends ViewGroup
public int getEmptyBottomMargin() {
int emptyMargin = mMaxLayoutHeight - mContentHeight;
if (needsHeightAdaption()) {
- emptyMargin = emptyMargin - mCollapsedSize - mBottomStackPeekSize;
+ emptyMargin = emptyMargin - mBottomStackSlowDownHeight - mBottomStackPeekSize;
}
return Math.max(emptyMargin, 0);
}
@@ -1231,6 +1240,7 @@ public class NotificationStackScrollLayout extends ViewGroup
public void setDimmed(boolean dimmed, boolean animate) {
mStackScrollAlgorithm.setDimmed(dimmed);
mAmbientState.setDimmed(dimmed);
+ updatePadding(dimmed);
if (animate) {
mDimmedNeedsAnimation = true;
mNeedsAnimation = true;