diff options
author | Selim Cinek <cinek@google.com> | 2014-04-23 17:24:37 +0200 |
---|---|---|
committer | Selim Cinek <cinek@google.com> | 2014-04-23 17:50:48 +0200 |
commit | b6e0e1228bfd38f5ba971194afc5c31d99980fa1 (patch) | |
tree | 60e95fe9fb545f0754420dc847048c3cf7b4dde9 | |
parent | 21de56a94668e0fda1b8bb4ee4f99a09b40d28fd (diff) | |
download | frameworks_base-b6e0e1228bfd38f5ba971194afc5c31d99980fa1.zip frameworks_base-b6e0e1228bfd38f5ba971194afc5c31d99980fa1.tar.gz frameworks_base-b6e0e1228bfd38f5ba971194afc5c31d99980fa1.tar.bz2 |
Fixed a bug where holes could occur in the new shade.
When a notification was never layouted before and it was the first
child, holes could occur in the shade when dragging down, because its
maximum allowed height was wrongly calculated.
Bug: 14080722
Change-Id: Ia10f9dd95f917d492411aec1da4ae0fc4d8f33d5
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java | 2 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index 56f83df..bb481ec 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -172,7 +172,7 @@ public class ExpandableNotificationRow extends FrameLayout int oldHeight = lp.height; lp.height = ViewGroup.LayoutParams.WRAP_CONTENT; setLayoutParams(lp); - measure(View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), View.MeasureSpec.EXACTLY), + measure(View.MeasureSpec.makeMeasureSpec(getWidth(), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(mRowMaxHeight, View.MeasureSpec.AT_MOST)); lp.height = oldHeight; setLayoutParams(lp); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java index a7363f4..d9e7f66 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java @@ -533,7 +533,23 @@ public class StackScrollAlgorithm { } else { // We are expanding the shade, expand it to its full height. - mFirstChildMaxHeight = getMaxAllowedChildHeight(mFirstChildWhileExpanding); + if (mFirstChildWhileExpanding.getWidth() == 0) { + + // This child was not layouted yet, wait for a layout pass + mFirstChildWhileExpanding + .addOnLayoutChangeListener(new View.OnLayoutChangeListener() { + @Override + public void onLayoutChange(View v, int left, int top, int right, + int bottom, int oldLeft, int oldTop, int oldRight, + int oldBottom) { + mFirstChildMaxHeight = getMaxAllowedChildHeight( + mFirstChildWhileExpanding); + mFirstChildWhileExpanding.removeOnLayoutChangeListener(this); + } + }); + } else { + mFirstChildMaxHeight = getMaxAllowedChildHeight(mFirstChildWhileExpanding); + } } } else { mFirstChildMaxHeight = 0; |