diff options
| -rw-r--r-- | packages/SystemUI/res/values-television/config.xml | 6 | ||||
| -rw-r--r-- | packages/SystemUI/res/values/config.xml | 6 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java | 22 |
3 files changed, 25 insertions, 9 deletions
diff --git a/packages/SystemUI/res/values-television/config.xml b/packages/SystemUI/res/values-television/config.xml index 29c3ad4bb77b..015ac90e2521 100644 --- a/packages/SystemUI/res/values-television/config.xml +++ b/packages/SystemUI/res/values-television/config.xml @@ -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> diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 446ed3eee3d2..d63724df0163 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -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> diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java index 43754a2e94ae..9a0f040d3513 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java @@ -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(); |