Merge "Fixed several bugs where the dismissview was not reachable." into lmp-dev
This commit is contained in:
@@ -276,13 +276,21 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
boolean updateExpandHeight = mMaxExpandHeight == 0 && !mWasReset;
|
||||
mMaxExpandHeight = mPrivateLayout.getMaxHeight();
|
||||
updateMaxExpandHeight();
|
||||
if (updateExpandHeight) {
|
||||
applyExpansionToLayout();
|
||||
}
|
||||
mWasReset = false;
|
||||
}
|
||||
|
||||
private void updateMaxExpandHeight() {
|
||||
int intrinsicBefore = getIntrinsicHeight();
|
||||
mMaxExpandHeight = mPrivateLayout.getMaxHeight();
|
||||
if (intrinsicBefore != getIntrinsicHeight()) {
|
||||
notifyHeightChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void setSensitive(boolean sensitive) {
|
||||
mSensitive = sensitive;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,10 @@ public abstract class ExpandableView extends FrameLayout {
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
if (!mActualHeightInitialized && mActualHeight == 0) {
|
||||
setActualHeight(getInitialHeight());
|
||||
int initialHeight = getInitialHeight();
|
||||
if (initialHeight != 0) {
|
||||
setActualHeight(initialHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2094,15 +2094,16 @@ public class NotificationStackScrollLayout extends ViewGroup
|
||||
int oldVisibility = mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility();
|
||||
int newVisibility = visible ? VISIBLE : GONE;
|
||||
if (oldVisibility != newVisibility) {
|
||||
if (oldVisibility == GONE) {
|
||||
if (newVisibility != GONE) {
|
||||
if (mEmptyShadeView.willBeGone()) {
|
||||
mEmptyShadeView.cancelAnimation();
|
||||
} else {
|
||||
mEmptyShadeView.setInvisible();
|
||||
mEmptyShadeView.setVisibility(newVisibility);
|
||||
}
|
||||
mEmptyShadeView.setVisibility(newVisibility);
|
||||
mEmptyShadeView.setWillBeGone(false);
|
||||
updateContentHeight();
|
||||
notifyHeightChangeListener(mDismissView);
|
||||
} else {
|
||||
mEmptyShadeView.setWillBeGone(true);
|
||||
mEmptyShadeView.performVisibilityAnimation(false, new Runnable() {
|
||||
@@ -2111,6 +2112,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
||||
mEmptyShadeView.setVisibility(GONE);
|
||||
mEmptyShadeView.setWillBeGone(false);
|
||||
updateContentHeight();
|
||||
notifyHeightChangeListener(mDismissView);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2121,15 +2123,16 @@ public class NotificationStackScrollLayout extends ViewGroup
|
||||
int oldVisibility = mDismissView.willBeGone() ? GONE : mDismissView.getVisibility();
|
||||
int newVisibility = visible ? VISIBLE : GONE;
|
||||
if (oldVisibility != newVisibility) {
|
||||
if (oldVisibility == GONE) {
|
||||
if (newVisibility != GONE) {
|
||||
if (mDismissView.willBeGone()) {
|
||||
mDismissView.cancelAnimation();
|
||||
} else {
|
||||
mDismissView.setInvisible();
|
||||
mDismissView.setVisibility(newVisibility);
|
||||
}
|
||||
mDismissView.setVisibility(newVisibility);
|
||||
mDismissView.setWillBeGone(false);
|
||||
updateContentHeight();
|
||||
notifyHeightChangeListener(mDismissView);
|
||||
} else {
|
||||
mDismissView.setWillBeGone(true);
|
||||
mDismissView.performVisibilityAnimation(false, new Runnable() {
|
||||
@@ -2138,6 +2141,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
||||
mDismissView.setVisibility(GONE);
|
||||
mDismissView.setWillBeGone(false);
|
||||
updateContentHeight();
|
||||
notifyHeightChangeListener(mDismissView);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -166,6 +166,7 @@ public class StackStateAnimator {
|
||||
boolean hasDelays = mAnimationFilter.hasDelays;
|
||||
boolean isDelayRelevant = yTranslationChanging || zTranslationChanging || scaleChanging ||
|
||||
alphaChanging || heightChanging || topInsetChanging;
|
||||
boolean noAnimation = wasAdded && !mAnimationFilter.hasGoToFullShadeEvent;
|
||||
long delay = 0;
|
||||
long duration = mCurrentLength;
|
||||
if (hasDelays && isDelayRelevant || wasAdded) {
|
||||
@@ -183,46 +184,72 @@ public class StackStateAnimator {
|
||||
|
||||
// start translationY animation
|
||||
if (yTranslationChanging) {
|
||||
startYTranslationAnimation(child, viewState, duration, delay);
|
||||
if (noAnimation) {
|
||||
child.setTranslationY(viewState.yTranslation);
|
||||
} else {
|
||||
startYTranslationAnimation(child, viewState, duration, delay);
|
||||
}
|
||||
}
|
||||
|
||||
// start translationZ animation
|
||||
if (zTranslationChanging) {
|
||||
startZTranslationAnimation(child, viewState, duration, delay);
|
||||
if (noAnimation) {
|
||||
child.setTranslationZ(viewState.zTranslation);
|
||||
} else {
|
||||
startZTranslationAnimation(child, viewState, duration, delay);
|
||||
}
|
||||
}
|
||||
|
||||
// start scale animation
|
||||
if (scaleChanging) {
|
||||
startScaleAnimation(child, viewState, duration);
|
||||
if (noAnimation) {
|
||||
child.setScaleX(viewState.scale);
|
||||
child.setScaleY(viewState.scale);
|
||||
} else {
|
||||
startScaleAnimation(child, viewState, duration);
|
||||
}
|
||||
}
|
||||
|
||||
// start alpha animation
|
||||
if (alphaChanging && child.getTranslationX() == 0) {
|
||||
startAlphaAnimation(child, viewState, duration, delay);
|
||||
if (noAnimation) {
|
||||
child.setAlpha(viewState.alpha);
|
||||
} else {
|
||||
startAlphaAnimation(child, viewState, duration, delay);
|
||||
}
|
||||
}
|
||||
|
||||
// start height animation
|
||||
if (heightChanging) {
|
||||
startHeightAnimation(child, viewState, duration, delay);
|
||||
if (heightChanging && child.getActualHeight() != 0) {
|
||||
if (noAnimation) {
|
||||
child.setActualHeight(viewState.height, false);
|
||||
} else {
|
||||
startHeightAnimation(child, viewState, duration, delay);
|
||||
}
|
||||
}
|
||||
|
||||
// start top inset animation
|
||||
if (topInsetChanging) {
|
||||
startInsetAnimation(child, viewState, duration, delay);
|
||||
if (noAnimation) {
|
||||
child.setClipTopAmount(viewState.clipTopAmount);
|
||||
} else {
|
||||
startInsetAnimation(child, viewState, duration, delay);
|
||||
}
|
||||
}
|
||||
|
||||
// start dimmed animation
|
||||
child.setDimmed(viewState.dimmed, mAnimationFilter.animateDimmed && !wasAdded);
|
||||
child.setDimmed(viewState.dimmed, mAnimationFilter.animateDimmed && !wasAdded
|
||||
&& !noAnimation);
|
||||
|
||||
// start dark animation
|
||||
child.setDark(viewState.dark, mAnimationFilter.animateDark);
|
||||
child.setDark(viewState.dark, mAnimationFilter.animateDark && !noAnimation);
|
||||
|
||||
// apply speed bump state
|
||||
child.setBelowSpeedBump(viewState.belowSpeedBump);
|
||||
|
||||
// start hiding sensitive animation
|
||||
child.setHideSensitive(viewState.hideSensitive,
|
||||
mAnimationFilter.animateHideSensitive && !wasAdded, delay, duration);
|
||||
child.setHideSensitive(viewState.hideSensitive, mAnimationFilter.animateHideSensitive &&
|
||||
!wasAdded && !noAnimation, delay, duration);
|
||||
|
||||
// apply scrimming
|
||||
child.setScrimAmount(viewState.scrimAmount);
|
||||
|
||||
Reference in New Issue
Block a user