From fa8f2cc00dec3cd970508c19320ff8a4f41339c7 Mon Sep 17 00:00:00 2001 From: Raj Yengisetty Date: Mon, 30 Mar 2015 17:56:01 -0700 Subject: Profiles: play Ringtone when setting volume overrides Change-Id: Ibd171f9fcbf96aa0dae9a1dafb6fb07105b2f4c8 --- .../android/settings/profiles/SetupActionsFragment.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/com/android/settings/profiles') diff --git a/src/com/android/settings/profiles/SetupActionsFragment.java b/src/com/android/settings/profiles/SetupActionsFragment.java index baa901e..199e477 100644 --- a/src/com/android/settings/profiles/SetupActionsFragment.java +++ b/src/com/android/settings/profiles/SetupActionsFragment.java @@ -40,6 +40,7 @@ import android.net.wimax.WimaxHelper; import android.nfc.NfcManager; import android.os.AsyncTask; import android.os.Bundle; +import android.preference.SeekBarVolumizer; import android.provider.Settings; import android.telecom.TelecomManager; import android.telephony.TelephonyManager; @@ -695,8 +696,9 @@ public class SetupActionsFragment extends SettingsPreferenceFragment } }); seekBar.setEnabled(streamSettings.isOverride()); - seekBar.setMax(am.getStreamMaxVolume(streamId)); - seekBar.setProgress(streamSettings.getValue()); + final SeekBarVolumizer volumizer = new SeekBarVolumizer(getActivity(), streamId, null, + null); + volumizer.setSeekBar(seekBar); builder.setView(view); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override @@ -710,6 +712,14 @@ public class SetupActionsFragment extends SettingsPreferenceFragment } }); builder.setNegativeButton(android.R.string.cancel, null); + builder.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialogInterface) { + if (volumizer != null) { + volumizer.stop(); + } + } + }); builder.show(); } -- cgit v1.1