am b9144cea: Merge "Clear the initialized flag when resetting the height." into lmp-mr1-dev

* commit 'b9144cea5184c90534db75b47e3818a688e64d5b':
  Clear the initialized flag when resetting the height.
This commit is contained in:
Chris Wren
2014-10-31 19:15:20 +00:00
committed by Android Git Automerger
4 changed files with 13 additions and 7 deletions

View File

@@ -508,7 +508,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
if (mAppearAnimator != null) { if (mAppearAnimator != null) {
mAppearAnimator.cancel(); mAppearAnimator.cancel();
} }
mAnimationTranslationY = translationDirection * mActualHeight; mAnimationTranslationY = translationDirection * getActualHeight();
if (mAppearAnimationFraction == -1.0f) { if (mAppearAnimationFraction == -1.0f) {
// not initialized yet, we start anew // not initialized yet, we start anew
if (isAppearing) { if (isAppearing) {
@@ -601,14 +601,15 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
float top; float top;
float bottom; float bottom;
final int actualHeight = getActualHeight();
if (mAnimationTranslationY > 0.0f) { if (mAnimationTranslationY > 0.0f) {
bottom = mActualHeight - heightFraction * mAnimationTranslationY * 0.1f bottom = actualHeight - heightFraction * mAnimationTranslationY * 0.1f
- translateYTotalAmount; - translateYTotalAmount;
top = bottom * heightFraction; top = bottom * heightFraction;
} else { } else {
top = heightFraction * (mActualHeight + mAnimationTranslationY) * 0.1f - top = heightFraction * (actualHeight + mAnimationTranslationY) * 0.1f -
translateYTotalAmount; translateYTotalAmount;
bottom = mActualHeight * (1 - heightFraction) + top * heightFraction; bottom = actualHeight * (1 - heightFraction) + top * heightFraction;
} }
mAppearAnimationRect.set(left, top, right, bottom); mAppearAnimationRect.set(left, top, right, bottom);
setOutlineRect(left, top + mAppearAnimationTranslation, right, setOutlineRect(left, top + mAppearAnimationTranslation, right,

View File

@@ -154,9 +154,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
} }
public void resetHeight() { public void resetHeight() {
super.resetHeight();
mMaxExpandHeight = 0; mMaxExpandHeight = 0;
mWasReset = true; mWasReset = true;
mActualHeight = 0;
onHeightReset(); onHeightReset();
requestLayout(); requestLayout();
} }

View File

@@ -41,7 +41,7 @@ public abstract class ExpandableOutlineView extends ExpandableView {
outline.setRect(0, outline.setRect(0,
mClipTopAmount, mClipTopAmount,
getWidth(), getWidth(),
Math.max(mActualHeight, mClipTopAmount)); Math.max(getActualHeight(), mClipTopAmount));
} else { } else {
outline.setRect(mOutlineRect); outline.setRect(mOutlineRect);
} }

View File

@@ -36,7 +36,7 @@ public abstract class ExpandableView extends FrameLayout {
private final int mMaxNotificationHeight; private final int mMaxNotificationHeight;
private OnHeightChangedListener mOnHeightChangedListener; private OnHeightChangedListener mOnHeightChangedListener;
protected int mActualHeight; private int mActualHeight;
protected int mClipTopAmount; protected int mClipTopAmount;
private boolean mActualHeightInitialized; private boolean mActualHeightInitialized;
private ArrayList<View> mMatchParentViews = new ArrayList<View>(); private ArrayList<View> mMatchParentViews = new ArrayList<View>();
@@ -103,6 +103,11 @@ public abstract class ExpandableView extends FrameLayout {
} }
} }
protected void resetHeight() {
mActualHeight = 0;
mActualHeightInitialized = false;
}
protected int getInitialHeight() { protected int getInitialHeight() {
return getHeight(); return getHeight();
} }