diff options
| author | Selim Cinek <cinek@google.com> | 2014-05-20 01:42:46 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-20 01:42:46 +0000 |
| commit | e704324a01000cad912c3c637e6341dd82306763 (patch) | |
| tree | 425b3e28273a15c5a216caa058b144f972a7bfba /packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java | |
| parent | f3281e4a3ce7e34a5c75cc5ea5d8fb356c2c4c66 (diff) | |
| parent | c9c00ae2fa5fb787e9f12705f8cd8de445ecde4b (diff) | |
| download | frameworks_base-e704324a01000cad912c3c637e6341dd82306763.zip frameworks_base-e704324a01000cad912c3c637e6341dd82306763.tar.gz frameworks_base-e704324a01000cad912c3c637e6341dd82306763.tar.bz2 | |
Merge "Fixed several bugs introduced by the new background views."
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java')
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java index 724b6a4..0f214a2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java @@ -45,6 +45,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView = new PathInterpolator(0.6f, 0, 0.5f, 1); private static final Interpolator ACTIVATE_INVERSE_ALPHA_INTERPOLATOR = new PathInterpolator(0, 0, 0.5f, 1); + private final int mMaxNotificationHeight; private boolean mDimmed; @@ -80,6 +81,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView AnimationUtils.loadInterpolator(context, android.R.interpolator.fast_out_slow_in); mLinearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context, android.R.interpolator.linear_out_slow_in); + mMaxNotificationHeight = getResources().getDimensionPixelSize(R.dimen.notification_max_height); setClipChildren(false); setClipToPadding(false); } @@ -293,6 +295,27 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView } @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + int newHeightSpec = MeasureSpec.makeMeasureSpec(mMaxNotificationHeight, + MeasureSpec.AT_MOST); + int maxChildHeight = 0; + int childCount = getChildCount(); + for (int i = 0; i < childCount; i++) { + View child = getChildAt(i); + if (child != mBackgroundDimmed && child != mBackgroundNormal) { + child.measure(widthMeasureSpec, newHeightSpec); + int childHeight = child.getMeasuredHeight(); + maxChildHeight = Math.max(maxChildHeight, childHeight); + } + } + newHeightSpec = MeasureSpec.makeMeasureSpec(maxChildHeight, MeasureSpec.EXACTLY); + mBackgroundDimmed.measure(widthMeasureSpec, newHeightSpec); + mBackgroundNormal.measure(widthMeasureSpec, newHeightSpec); + int width = MeasureSpec.getSize(widthMeasureSpec); + setMeasuredDimension(width, maxChildHeight); + } + + @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); setPivotX(getWidth() / 2); |
