summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Anthony Tripaldi <atripaldi@google.com> 2019-04-24 17:30:13 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-04-24 17:30:13 +0000
commite0b95fbe37494fffd2be414b03d134f68e28b0df (patch)
treef233ee932e0a0a86439da3603822cb9defe89d5d
parent9a5f74f0900a61825511cedc61bd8486286dfe8e (diff)
parent1bb7a3ce501b2fd8dc13dd1f946856a659ac20f3 (diff)
Merge "Fix bug with blinking caption tooltip on rocker click. Also clean up some older code that flashed the dialog on screen initially and triggered dismiss too often." into qt-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
index 8d9c5a3740b2..43912f9eb4f7 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
@@ -27,6 +27,7 @@ import static android.media.AudioManager.STREAM_RING;
import static android.media.AudioManager.STREAM_VOICE_CALL;
import static android.view.View.ACCESSIBILITY_LIVE_REGION_POLITE;
import static android.view.View.GONE;
+import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
@@ -228,9 +229,10 @@ public class VolumeDialogImpl implements VolumeDialog,
mDialog.setContentView(R.layout.volume_dialog);
mDialogView = mDialog.findViewById(R.id.volume_dialog);
+ mDialogView.setAlpha(0);
mDialog.setCanceledOnTouchOutside(true);
mDialog.setOnShowListener(dialog -> {
- if (!isLandscape()) mDialogView.setTranslationX(mDialogView.getWidth() / 2);
+ if (!isLandscape()) mDialogView.setTranslationX(mDialogView.getWidth() / 2.0f);
mDialogView.setAlpha(0);
mDialogView.animate()
.alpha(1)
@@ -528,7 +530,7 @@ public class VolumeDialogImpl implements VolumeDialog,
if (!mHasSeenODICaptionsTooltip && !fromDismiss && mODICaptionsTooltipViewStub != null) {
mController.getCaptionsComponentState(true);
} else {
- if (mHasSeenODICaptionsTooltip && mODICaptionsTooltipView != null) {
+ if (mHasSeenODICaptionsTooltip && fromDismiss && mODICaptionsTooltipView != null) {
hideCaptionsTooltip();
}
}
@@ -565,13 +567,14 @@ public class VolumeDialogImpl implements VolumeDialog,
}
private void hideCaptionsTooltip() {
- if (mODICaptionsTooltipView != null) {
+ if (mODICaptionsTooltipView != null && mODICaptionsTooltipView.getVisibility() == VISIBLE) {
mODICaptionsTooltipView.animate().cancel();
mODICaptionsTooltipView.setAlpha(1.f);
mODICaptionsTooltipView.animate()
.alpha(0.f)
.setStartDelay(0)
.setDuration(DIALOG_HIDE_ANIMATION_DURATION)
+ .withEndAction(() -> mODICaptionsTooltipView.setVisibility(INVISIBLE))
.start();
}
}
@@ -677,7 +680,7 @@ public class VolumeDialogImpl implements VolumeDialog,
}
private void showH(int reason) {
- if (D.BUG) Log.d(TAG, "showH r=" + Events.DISMISS_REASONS[reason]);
+ if (D.BUG) Log.d(TAG, "showH r=" + Events.SHOW_REASONS[reason]);
mHandler.removeMessages(H.SHOW);
mHandler.removeMessages(H.DISMISS);
rescheduleTimeoutH();
@@ -750,7 +753,7 @@ public class VolumeDialogImpl implements VolumeDialog,
mDialog.dismiss();
tryToRemoveCaptionsTooltip();
}, 50));
- if (!isLandscape()) animator.translationX(mDialogView.getWidth() / 2);
+ if (!isLandscape()) animator.translationX(mDialogView.getWidth() / 2.0f);
animator.start();
checkODICaptionsTooltip(true);
mController.notifyVisible(false);