Merge "Allow customization of timeout value for expanded volume dialog" into qt-qpr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f40ed95801
@@ -37,4 +37,6 @@
|
||||
<!-- Timeout values in milliseconds for displaying volume dialog-->
|
||||
<integer name="car_volume_dialog_display_normal_timeout">3000</integer>
|
||||
<integer name="car_volume_dialog_display_hovering_timeout">16000</integer>
|
||||
<integer name="car_volume_dialog_display_expanded_normal_timeout">6000</integer>
|
||||
<integer name="car_volume_dialog_display_expanded_hovering_timeout">32000</integer>
|
||||
</resources>
|
||||
|
||||
@@ -92,6 +92,8 @@ public class CarVolumeDialogImpl implements VolumeDialog {
|
||||
private final KeyguardManager mKeyguard;
|
||||
private final int mNormalTimeout;
|
||||
private final int mHoveringTimeout;
|
||||
private final int mExpNormalTimeout;
|
||||
private final int mExpHoveringTimeout;
|
||||
|
||||
private Window mWindow;
|
||||
private CustomDialog mDialog;
|
||||
@@ -180,6 +182,10 @@ public class CarVolumeDialogImpl implements VolumeDialog {
|
||||
R.integer.car_volume_dialog_display_normal_timeout);
|
||||
mHoveringTimeout = mContext.getResources().getInteger(
|
||||
R.integer.car_volume_dialog_display_hovering_timeout);
|
||||
mExpNormalTimeout = mContext.getResources().getInteger(
|
||||
R.integer.car_volume_dialog_display_expanded_normal_timeout);
|
||||
mExpHoveringTimeout = mContext.getResources().getInteger(
|
||||
R.integer.car_volume_dialog_display_expanded_hovering_timeout);
|
||||
}
|
||||
|
||||
private static int getSeekbarValue(CarAudioManager carAudioManager, int volumeGroupId) {
|
||||
@@ -328,7 +334,11 @@ public class CarVolumeDialogImpl implements VolumeDialog {
|
||||
}
|
||||
|
||||
private int computeTimeoutH() {
|
||||
return mHovering ? mHoveringTimeout : mNormalTimeout;
|
||||
if (mExpanded) {
|
||||
return mHovering ? mExpHoveringTimeout : mExpNormalTimeout;
|
||||
} else {
|
||||
return mHovering ? mHoveringTimeout : mNormalTimeout;
|
||||
}
|
||||
}
|
||||
|
||||
private void dismissH(int reason) {
|
||||
@@ -547,6 +557,7 @@ public class CarVolumeDialogImpl implements VolumeDialog {
|
||||
public void onClick(final View v) {
|
||||
mExpandIcon = v;
|
||||
toggleDialogExpansion(true);
|
||||
rescheduleTimeoutH();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user