Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +17 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar; import android.content.Context; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.view.MotionEvent; Loading Loading @@ -44,6 +45,7 @@ public abstract class ExpandableView extends FrameLayout { private static Rect mClipRect = new Rect(); private boolean mWillBeGone; private int mMinClipTopAmount = 0; private boolean mMeasuredTooHigh; public ExpandableView(Context context, AttributeSet attrs) { super(context, attrs); Loading @@ -54,12 +56,13 @@ public abstract class ExpandableView extends FrameLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { boolean limitViewHeight = shouldLimitViewHeight(); final int givenSize = MeasureSpec.getSize(heightMeasureSpec); int ownMaxHeight = limitViewHeight ? mMaxViewHeight : Integer.MAX_VALUE; int heightMode = MeasureSpec.getMode(heightMeasureSpec); boolean hasFixedHeight = heightMode == MeasureSpec.EXACTLY; if (hasFixedHeight) { // We have a height set in our layout, so we want to be at most as big as given ownMaxHeight = Math.min(MeasureSpec.getSize(heightMeasureSpec), ownMaxHeight); ownMaxHeight = Math.min(givenSize, ownMaxHeight); } int newHeightSpec = MeasureSpec.makeMeasureSpec(ownMaxHeight, MeasureSpec.AT_MOST); int maxChildHeight = 0; Loading Loading @@ -97,6 +100,7 @@ public abstract class ExpandableView extends FrameLayout { mMatchParentViews.clear(); int width = MeasureSpec.getSize(widthMeasureSpec); setMeasuredDimension(width, ownHeight); mMeasuredTooHigh = heightMode != MeasureSpec.UNSPECIFIED && ownHeight > givenSize; } protected boolean shouldLimitViewHeight() { Loading Loading @@ -384,6 +388,18 @@ public abstract class ExpandableView extends FrameLayout { mMinClipTopAmount = minClipTopAmount; } @Override public void setLayerType(int layerType, Paint paint) { if (hasOverlappingRendering()) { super.setLayerType(layerType, paint); } } @Override public boolean hasOverlappingRendering() { return super.hasOverlappingRendering() && !mMeasuredTooHigh; } /** * A listener notifying when {@link #getActualHeight} changes. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java +2 −2 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ public class NotificationChildrenContainer extends ViewGroup { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { int childCount = mChildren.size(); int childCount = Math.min(mChildren.size(), NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED); for (int i = 0; i < childCount; i++) { View child = mChildren.get(i); if (child.getVisibility() == View.GONE) { Loading Loading @@ -118,7 +118,7 @@ public class NotificationChildrenContainer extends ViewGroup { int newHeightSpec = MeasureSpec.makeMeasureSpec(ownMaxHeight, MeasureSpec.AT_MOST); int dividerHeightSpec = MeasureSpec.makeMeasureSpec(mDividerHeight, MeasureSpec.EXACTLY); int height = mNotificationHeaderHeight + mNotificatonTopPadding; int childCount = mChildren.size(); int childCount = Math.min(mChildren.size(), NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED); for (int i = 0; i < childCount; i++) { View child = mChildren.get(i); child.measure(widthMeasureSpec, newHeightSpec); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +17 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar; import android.content.Context; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.view.MotionEvent; Loading Loading @@ -44,6 +45,7 @@ public abstract class ExpandableView extends FrameLayout { private static Rect mClipRect = new Rect(); private boolean mWillBeGone; private int mMinClipTopAmount = 0; private boolean mMeasuredTooHigh; public ExpandableView(Context context, AttributeSet attrs) { super(context, attrs); Loading @@ -54,12 +56,13 @@ public abstract class ExpandableView extends FrameLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { boolean limitViewHeight = shouldLimitViewHeight(); final int givenSize = MeasureSpec.getSize(heightMeasureSpec); int ownMaxHeight = limitViewHeight ? mMaxViewHeight : Integer.MAX_VALUE; int heightMode = MeasureSpec.getMode(heightMeasureSpec); boolean hasFixedHeight = heightMode == MeasureSpec.EXACTLY; if (hasFixedHeight) { // We have a height set in our layout, so we want to be at most as big as given ownMaxHeight = Math.min(MeasureSpec.getSize(heightMeasureSpec), ownMaxHeight); ownMaxHeight = Math.min(givenSize, ownMaxHeight); } int newHeightSpec = MeasureSpec.makeMeasureSpec(ownMaxHeight, MeasureSpec.AT_MOST); int maxChildHeight = 0; Loading Loading @@ -97,6 +100,7 @@ public abstract class ExpandableView extends FrameLayout { mMatchParentViews.clear(); int width = MeasureSpec.getSize(widthMeasureSpec); setMeasuredDimension(width, ownHeight); mMeasuredTooHigh = heightMode != MeasureSpec.UNSPECIFIED && ownHeight > givenSize; } protected boolean shouldLimitViewHeight() { Loading Loading @@ -384,6 +388,18 @@ public abstract class ExpandableView extends FrameLayout { mMinClipTopAmount = minClipTopAmount; } @Override public void setLayerType(int layerType, Paint paint) { if (hasOverlappingRendering()) { super.setLayerType(layerType, paint); } } @Override public boolean hasOverlappingRendering() { return super.hasOverlappingRendering() && !mMeasuredTooHigh; } /** * A listener notifying when {@link #getActualHeight} changes. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java +2 −2 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ public class NotificationChildrenContainer extends ViewGroup { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { int childCount = mChildren.size(); int childCount = Math.min(mChildren.size(), NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED); for (int i = 0; i < childCount; i++) { View child = mChildren.get(i); if (child.getVisibility() == View.GONE) { Loading Loading @@ -118,7 +118,7 @@ public class NotificationChildrenContainer extends ViewGroup { int newHeightSpec = MeasureSpec.makeMeasureSpec(ownMaxHeight, MeasureSpec.AT_MOST); int dividerHeightSpec = MeasureSpec.makeMeasureSpec(mDividerHeight, MeasureSpec.EXACTLY); int height = mNotificationHeaderHeight + mNotificatonTopPadding; int childCount = mChildren.size(); int childCount = Math.min(mChildren.size(), NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED); for (int i = 0; i < childCount; i++) { View child = mChildren.get(i); child.measure(widthMeasureSpec, newHeightSpec); Loading