Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aad60c30 authored by Anthony Tripaldi's avatar Anthony Tripaldi Committed by android-build-merger
Browse files

Merge "Fix bug with blinking caption tooltip on rocker click. Also clean up...

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 am: e0b95fbe
am: 9d4e80e7

Change-Id: I013e6cb421820e144eed516fd001b16a6b7ebaf6
parents ae25563a 9d4e80e7
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -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);