Settings: Use List Preference for Dock speaker plays and Emergency tone

Change-Id: Ia899f2ba6d4663c2315ee35c093ca14cb26ae450
This commit is contained in:
someone5678
2025-01-05 14:20:59 +09:00
committed by Joey
parent 42ab19853b
commit 6f6aa340cf
2 changed files with 6 additions and 6 deletions

View File

@@ -269,7 +269,7 @@
android:order="-27"/>
<!-- Dock speaker plays -->
<DropDownPreference
<ListPreference
android:key="dock_audio_media"
android:title="@string/dock_audio_media_title"
android:summary="%s"
@@ -282,7 +282,7 @@
android:order="-15"/>
<!-- Emergency tone -->
<DropDownPreference
<ListPreference
android:key="emergency_tone"
android:title="@string/emergency_tone_title"
android:summary="%s"

View File

@@ -24,7 +24,7 @@ import android.provider.Settings.Global;
import android.provider.Settings.Secure;
import android.provider.Settings.System;
import androidx.preference.DropDownPreference;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.TwoStatePreference;
@@ -45,7 +45,7 @@ public class SettingPref {
private final Uri mUri;
protected TwoStatePreference mTwoState;
protected DropDownPreference mDropDown;
protected ListPreference mDropDown;
public SettingPref(int type, String key, String setting, int def, int... values) {
mType = type;
@@ -73,8 +73,8 @@ public class SettingPref {
}
if (p instanceof TwoStatePreference) {
mTwoState = (TwoStatePreference) p;
} else if (p instanceof DropDownPreference) {
mDropDown = (DropDownPreference) p;
} else if (p instanceof ListPreference) {
mDropDown = (ListPreference) p;
CharSequence[] entries = new CharSequence[mValues.length];
CharSequence[] values = new CharSequence[mValues.length];
for (int i = 0; i < mValues.length; i++) {