Revert "Revert "Replace dynamic summary text for SettingPref""

This reverts commit 8061aaef62.
Test: make RunSettingsRoboTests
Fixes: 36101902
Change-Id: Ide74780153fc7f36d897f559c7a3c138190e3320
This commit is contained in:
Matthew Fritze
2017-05-23 21:02:57 +00:00
parent 8061aaef62
commit c1e9f8787f
5 changed files with 83 additions and 4 deletions

View File

@@ -121,6 +121,19 @@ public class SettingPref {
if (mTwoState != null) {
mTwoState.setChecked(val != 0);
} else if (mDropDown != null) {
if (mValues != null) {
int index = 0;
for (int len = mValues.length; index < len; index++) {
if (mValues[index] == val) {
break;
}
}
if (index < mValues.length) {
CharSequence entry = mDropDown.getEntries()[index];
mDropDown.setSummary(entry);
}
}
mDropDown.setValue(Integer.toString(val));
}
}