Merge "Replace dynamic summary text for SettingPref" into oc-dev
am: 49b86b5c6a
Change-Id: Icb21526f03242d310824d20a21c82bd2f76893f2
This commit is contained in:
@@ -99,7 +99,6 @@ public class BatterySaverSettings extends SettingsPreferenceFragment
|
||||
}
|
||||
};
|
||||
mTriggerPref.init(this);
|
||||
|
||||
mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
|
||||
}
|
||||
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user