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

Commit acbb6dd7 authored by Galia Peycheva's avatar Galia Peycheva Committed by Android (Google) Code Review
Browse files

Merge "Add new show/hide anim duration for TV volume ui"

parents 968077be ab1b941f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -48,4 +48,10 @@

    <!-- Change the volume row tint when it is inactive, i.e. when it is being dismissed -->
    <bool name="config_changeVolumeRowTintWhenInactive">false</bool>

    <!-- The duraction of the show animation for the volume dialog in milliseconds -->
    <integer name="config_dialogShowAnimationDurationMs">600</integer>

    <!-- The duraction of the hide animation for the volume dialog in milliseconds -->
    <integer name="config_dialogHideAnimationDurationMs">400</integer>
</resources>
+6 −0
Original line number Diff line number Diff line
@@ -565,4 +565,10 @@

    <!-- Change the volume row tint when it is inactive, i.e. when it is being dismissed -->
    <bool name="config_changeVolumeRowTintWhenInactive">true</bool>

    <!-- The duraction of the show animation for the volume dialog in milliseconds -->
    <integer name="config_dialogShowAnimationDurationMs">300</integer>

    <!-- The duraction of the hide animation for the volume dialog in milliseconds -->
    <integer name="config_dialogHideAnimationDurationMs">250</integer>
</resources>
+13 −9
Original line number Diff line number Diff line
@@ -122,8 +122,11 @@ public class VolumeDialogImpl implements VolumeDialog,
    static final int DIALOG_SAFETYWARNING_TIMEOUT_MILLIS = 5000;
    static final int DIALOG_ODI_CAPTIONS_TOOLTIP_TIMEOUT_MILLIS = 5000;
    static final int DIALOG_HOVERING_TIMEOUT_MILLIS = 16000;
    static final int DIALOG_SHOW_ANIMATION_DURATION = 300;
    static final int DIALOG_HIDE_ANIMATION_DURATION = 250;

    private final int mDialogShowAnimationDurationMs;
    private final int mDialogHideAnimationDurationMs;
    private final boolean mShowLowMediaVolumeIcon;
    private final boolean mChangeVolumeRowTintWhenInactive;

    private final Context mContext;
    private final H mHandler = new H();
@@ -154,9 +157,6 @@ public class VolumeDialogImpl implements VolumeDialog,
    private boolean mShowing;
    private boolean mShowA11yStream;

    private final boolean mShowLowMediaVolumeIcon;
    private final boolean mChangeVolumeRowTintWhenInactive;

    private int mActiveStream;
    private int mPrevActiveStream;
    private boolean mAutomute = VolumePrefs.DEFAULT_ENABLE_AUTOMUTE;
@@ -186,6 +186,10 @@ public class VolumeDialogImpl implements VolumeDialog,
            mContext.getResources().getBoolean(R.bool.config_showLowMediaVolumeIcon);
        mChangeVolumeRowTintWhenInactive =
            mContext.getResources().getBoolean(R.bool.config_changeVolumeRowTintWhenInactive);
        mDialogShowAnimationDurationMs =
            mContext.getResources().getInteger(R.integer.config_dialogShowAnimationDurationMs);
        mDialogHideAnimationDurationMs =
            mContext.getResources().getInteger(R.integer.config_dialogHideAnimationDurationMs);
    }

    @Override
@@ -275,7 +279,7 @@ public class VolumeDialogImpl implements VolumeDialog,
            mDialogView.animate()
                    .alpha(1)
                    .translationX(0)
                    .setDuration(DIALOG_SHOW_ANIMATION_DURATION)
                    .setDuration(mDialogShowAnimationDurationMs)
                    .setInterpolator(new SystemUIInterpolators.LogDecelerateInterpolator())
                    .withEndAction(() -> {
                        if (!Prefs.getBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, false)) {
@@ -595,7 +599,7 @@ public class VolumeDialogImpl implements VolumeDialog,
            mODICaptionsTooltipView.setAlpha(0.f);
            mODICaptionsTooltipView.animate()
                .alpha(1.f)
                .setStartDelay(DIALOG_SHOW_ANIMATION_DURATION)
                .setStartDelay(mDialogShowAnimationDurationMs)
                .withEndAction(() -> {
                    if (D.BUG) Log.d(TAG, "tool:checkODICaptionsTooltip() putBoolean true");
                    Prefs.putBoolean(mContext,
@@ -617,7 +621,7 @@ public class VolumeDialogImpl implements VolumeDialog,
            mODICaptionsTooltipView.animate()
                    .alpha(0.f)
                    .setStartDelay(0)
                    .setDuration(DIALOG_HIDE_ANIMATION_DURATION)
                    .setDuration(mDialogHideAnimationDurationMs)
                    .withEndAction(() -> mODICaptionsTooltipView.setVisibility(INVISIBLE))
                    .start();
        }
@@ -796,7 +800,7 @@ public class VolumeDialogImpl implements VolumeDialog,
        mDialogView.setAlpha(1);
        ViewPropertyAnimator animator = mDialogView.animate()
                .alpha(0)
                .setDuration(DIALOG_HIDE_ANIMATION_DURATION)
                .setDuration(mDialogHideAnimationDurationMs)
                .setInterpolator(new SystemUIInterpolators.LogAccelerateInterpolator())
                .withEndAction(() -> mHandler.postDelayed(() -> {
                    mDialog.dismiss();