blob: 4fb4e60a5e720b4900967837b74214093432b467 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package james.dsp.preference;
import android.content.Context;
import android.preference.ListPreference;
import android.util.AttributeSet;
public class SummariedListPreference extends ListPreference
{
public SummariedListPreference(Context context, AttributeSet set)
{
super(context, set);
}
@Override
public void setValue(String value)
{
super.setValue(value);
CharSequence[] entries = getEntries();
CharSequence[] entryValues = getEntryValues();
for (int i = 0; i < entryValues.length; i++)
{
if (entryValues[i].equals(value))
{
setSummary(entries[i]);
break;
}
}
}
public void refreshFromPreference()
{
onSetInitialValue(true, null);
}
}
|