Merge "Make NPVC match on qpr and main"

This commit is contained in:
Justin Weir
2022-10-28 12:00:41 +00:00
committed by Android (Google) Code Review

View File

@@ -4218,8 +4218,8 @@ public final class NotificationPanelViewController {
/**
* Sets the dozing state.
*
* @param dozing {@code true} when dozing.
* @param animate if transition should be animated.
* @param dozing {@code true} when dozing.
* @param animate if transition should be animated.
*/
public void setDozing(boolean dozing, boolean animate) {
if (dozing == mDozing) return;
@@ -4359,35 +4359,35 @@ public final class NotificationPanelViewController {
/**
* Starts fold to AOD animation.
*
* @param startAction invoked when the animation starts.
* @param endAction invoked when the animation finishes, also if it was cancelled.
* @param startAction invoked when the animation starts.
* @param endAction invoked when the animation finishes, also if it was cancelled.
* @param cancelAction invoked when the animation is cancelled, before endAction.
*/
public void startFoldToAodAnimation(Runnable startAction, Runnable endAction,
Runnable cancelAction) {
mView.animate()
.translationX(0)
.alpha(1f)
.setDuration(ANIMATION_DURATION_FOLD_TO_AOD)
.setInterpolator(EMPHASIZED_DECELERATE)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
startAction.run();
}
.translationX(0)
.alpha(1f)
.setDuration(ANIMATION_DURATION_FOLD_TO_AOD)
.setInterpolator(EMPHASIZED_DECELERATE)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
startAction.run();
}
@Override
public void onAnimationCancel(Animator animation) {
cancelAction.run();
}
@Override
public void onAnimationCancel(Animator animation) {
cancelAction.run();
}
@Override
public void onAnimationEnd(Animator animation) {
endAction.run();
}
}).setUpdateListener(anim -> {
mKeyguardStatusViewController.animateFoldToAod(anim.getAnimatedFraction());
}).start();
@Override
public void onAnimationEnd(Animator animation) {
endAction.run();
}
}).setUpdateListener(anim -> {
mKeyguardStatusViewController.animateFoldToAod(anim.getAnimatedFraction());
}).start();
}
/**
@@ -4747,8 +4747,10 @@ public final class NotificationPanelViewController {
/**
* Maybe vibrate as panel is opened.
*
* @param openingWithTouch Whether the panel is being opened with touch. If the panel is instead
* being opened programmatically (such as by the open panel gesture), we always play haptic.
* @param openingWithTouch Whether the panel is being opened with touch. If the panel is
* instead
* being opened programmatically (such as by the open panel gesture), we
* always play haptic.
*/
private void maybeVibrateOnOpening(boolean openingWithTouch) {
if (mVibrateOnOpening) {
@@ -4914,10 +4916,12 @@ public final class NotificationPanelViewController {
animator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
animator.addListener(new AnimatorListenerAdapter() {
private boolean mCancelled;
@Override
public void onAnimationCancel(Animator animation) {
mCancelled = true;
}
@Override
public void onAnimationEnd(Animator animation) {
mIsSpringBackAnimation = false;
@@ -4965,7 +4969,7 @@ public final class NotificationPanelViewController {
if (isNaN(h)) {
Log.wtf(TAG, "ExpandedHeight set to NaN");
}
mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> {
mNotificationShadeWindowController.batchApplyWindowLayoutParams(() -> {
if (mExpandLatencyTracking && h != 0f) {
DejankUtils.postAfterTraversal(
() -> mLatencyTracker.onActionEnd(LatencyTracker.ACTION_EXPAND_PANEL));
@@ -5156,7 +5160,7 @@ public final class NotificationPanelViewController {
/**
* Create an animator that can also overshoot
*
* @param targetHeight the target height
* @param targetHeight the target height
* @param overshootAmount the amount of overshoot desired
*/
private ValueAnimator createHeightAnimator(float targetHeight, float overshootAmount) {
@@ -5916,7 +5920,7 @@ public final class NotificationPanelViewController {
public final class TouchHandler implements View.OnTouchListener {
private long mLastTouchDownTime = -1L;
/** @see ViewGroup#onInterceptTouchEvent(MotionEvent) */
/** @see ViewGroup#onInterceptTouchEvent(MotionEvent) */
public boolean onInterceptTouchEvent(MotionEvent event) {
if (SPEW_LOGCAT) {
Log.v(TAG,
@@ -6115,7 +6119,7 @@ public final class NotificationPanelViewController {
mShadeLog.logMotionEvent(event, "onTouch: touch ignored due to instant expanding");
return false;
}
if (mTouchDisabled && event.getActionMasked() != MotionEvent.ACTION_CANCEL) {
if (mTouchDisabled && event.getActionMasked() != MotionEvent.ACTION_CANCEL) {
mShadeLog.logMotionEvent(event, "onTouch: non-cancel action, touch disabled");
return false;
}
@@ -6323,3 +6327,4 @@ public final class NotificationPanelViewController {
}
}
}