Merge "Volume: Hide dialog when motion cancelled, as well as when finished." into tm-qpr-dev am: f597a6c3ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21940803 Change-Id: I31fe4099eb610d423c99237f49242479349e8232 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1400,7 +1400,11 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimationCancel(@NonNull Animator animation) {
|
public void onAnimationCancel(@NonNull Animator animation) {
|
||||||
mInteractionJankMonitor.cancel(CUJ_VOLUME_CONTROL);
|
mInteractionJankMonitor.cancel(CUJ_VOLUME_CONTROL);
|
||||||
Log.d(TAG, "onAnimationCancel");
|
Log.i(TAG, "onAnimationCancel");
|
||||||
|
|
||||||
|
// We can only have one animation listener for cancel, so the jank listener should
|
||||||
|
// also call for cleanup.
|
||||||
|
finishDismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1492,12 +1496,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
|||||||
.setDuration(mDialogHideAnimationDurationMs)
|
.setDuration(mDialogHideAnimationDurationMs)
|
||||||
.setInterpolator(new SystemUIInterpolators.LogAccelerateInterpolator())
|
.setInterpolator(new SystemUIInterpolators.LogAccelerateInterpolator())
|
||||||
.withEndAction(() -> mHandler.postDelayed(() -> {
|
.withEndAction(() -> mHandler.postDelayed(() -> {
|
||||||
mController.notifyVisible(false);
|
finishDismiss();
|
||||||
mDialog.dismiss();
|
|
||||||
tryToRemoveCaptionsTooltip();
|
|
||||||
mIsAnimatingDismiss = false;
|
|
||||||
|
|
||||||
hideRingerDrawer();
|
|
||||||
}, 50));
|
}, 50));
|
||||||
if (!shouldSlideInVolumeTray()) animator.translationX(mDialogView.getWidth() / 2.0f);
|
if (!shouldSlideInVolumeTray()) animator.translationX(mDialogView.getWidth() / 2.0f);
|
||||||
animator.setListener(getJankListener(getDialogView(), TYPE_DISMISS,
|
animator.setListener(getJankListener(getDialogView(), TYPE_DISMISS,
|
||||||
@@ -1512,6 +1511,18 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
|||||||
Trace.endSection();
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean up and hide volume dialog. Called when animation is finished/cancelled.
|
||||||
|
*/
|
||||||
|
private void finishDismiss() {
|
||||||
|
mController.notifyVisible(false);
|
||||||
|
mDialog.dismiss();
|
||||||
|
tryToRemoveCaptionsTooltip();
|
||||||
|
mIsAnimatingDismiss = false;
|
||||||
|
|
||||||
|
hideRingerDrawer();
|
||||||
|
}
|
||||||
|
|
||||||
private boolean showActiveStreamOnly() {
|
private boolean showActiveStreamOnly() {
|
||||||
return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)
|
return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)
|
||||||
|| mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION);
|
|| mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION);
|
||||||
|
|||||||
Reference in New Issue
Block a user