本文整理汇总了Java中android.preference.MultiSelectListPreference.getEntryValues方法的典型用法代码示例。如果您正苦于以下问题:Java MultiSelectListPreference.getEntryValues方法的具体用法?Java MultiSelectListPreference.getEntryValues怎么用?Java MultiSelectListPreference.getEntryValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.preference.MultiSelectListPreference
的用法示例。
在下文中一共展示了MultiSelectListPreference.getEntryValues方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updatePrefSummary
import android.preference.MultiSelectListPreference; //导入方法依赖的package包/类
private void updatePrefSummary(Preference p)
{
if (p instanceof ListPreference)
{
ListPreference listPref = (ListPreference) p;
p.setSummary(listPref.getEntry());
}
if (p instanceof EditTextPreference)
{
EditTextPreference editTextPref = (EditTextPreference) p;
if (p.getTitle().toString().contains("assword"))
{
p.setSummary("******");
}
else
{
p.setSummary(editTextPref.getText());
}
}
if (p instanceof MultiSelectListPreference)
{
MultiSelectListPreference editMultiListPref = (MultiSelectListPreference) p;
CharSequence[] entries = editMultiListPref.getEntries();
CharSequence[] entryValues = editMultiListPref.getEntryValues();
List<String> currentEntries = new ArrayList<>();
Set<String> currentEntryValues = editMultiListPref.getValues();
for (int i = 0; i < entries.length; i++)
{
if (currentEntryValues.contains(entryValues[i].toString())) currentEntries.add(entries[i].toString());
}
p.setSummary(currentEntries.toString());
}
}
示例2: updatePrefSummary
import android.preference.MultiSelectListPreference; //导入方法依赖的package包/类
private void updatePrefSummary(Preference p) {
if (smartAssignEnable.isChecked()) {
ignoreOutOfRangeEnable.setEnabled(true);
} else {
ignoreOutOfRangeEnable.setEnabled(false);
}
if (p instanceof ListPreference) {
ListPreference listPref = (ListPreference) p;
p.setSummary(listPref.getTitle());
}
if (p instanceof EditTextPreference) {
EditTextPreference editTextPref = (EditTextPreference) p;
if (p.getTitle().toString().contains("assword"))
{
p.setSummary("******");
} else {
p.setSummary(editTextPref.getText());
}
}
if (p instanceof MultiSelectListPreference) {
MultiSelectListPreference editMultiListPref = (MultiSelectListPreference) p;
CharSequence[] entries = editMultiListPref.getEntries();
CharSequence[] entryValues = editMultiListPref.getEntryValues();
List<String> currentEntries = new ArrayList<>();
Set<String> currentEntryValues = editMultiListPref.getValues();
for (int i = 0; i < entries.length; i++)
if (currentEntryValues.contains(entryValues[i]))
currentEntries.add(entries[i].toString());
p.setSummary(currentEntries.toString());
}
}
示例3: updatePrefSummary
import android.preference.MultiSelectListPreference; //导入方法依赖的package包/类
private void updatePrefSummary(Preference p) {
if (estimateWaterEnable.isChecked()) {
estimateWaterFormula.setEnabled(true);
} else {
estimateWaterFormula.setEnabled(false);
}
if (estimateLBWEnable.isChecked()) {
estimateLBWFormula.setEnabled(true);
} else {
estimateLBWFormula.setEnabled(false);
}
if (estimateFatEnable.isChecked()) {
estimateFatFormula.setEnabled(true);
} else {
estimateFatFormula.setEnabled(false);
}
if (fatEnable.isChecked()) {
fatPercentageEnable.setEnabled(true);
} else {
fatPercentageEnable.setEnabled(false);
}
if (waterEnable.isChecked()) {
waterPercentageEnable.setEnabled(true);
} else {
waterPercentageEnable.setEnabled(false);
}
if (muscleEnable.isChecked()) {
musclePercentageEnable.setEnabled(true);
} else {
musclePercentageEnable.setEnabled(false);
}
estimateWaterFormula.setSummary(EstimatedWaterMetric.getEstimatedMetric(EstimatedWaterMetric.FORMULA.valueOf(estimateWaterFormula.getValue())).getName());
estimateLBWFormula.setSummary(EstimatedLBWMetric.getEstimatedMetric(EstimatedLBWMetric.FORMULA.valueOf(estimateLBWFormula.getValue())).getName());
estimateFatFormula.setSummary(EstimatedFatMetric.getEstimatedMetric(EstimatedFatMetric.FORMULA.valueOf(estimateFatFormula.getValue())).getName());
if (p instanceof EditTextPreference) {
EditTextPreference editTextPref = (EditTextPreference) p;
if (p.getTitle().toString().contains("assword"))
{
p.setSummary("******");
} else {
p.setSummary(editTextPref.getText());
}
}
if (p instanceof MultiSelectListPreference) {
MultiSelectListPreference editMultiListPref = (MultiSelectListPreference) p;
CharSequence[] entries = editMultiListPref.getEntries();
CharSequence[] entryValues = editMultiListPref.getEntryValues();
List<String> currentEntries = new ArrayList<>();
Set<String> currentEntryValues = editMultiListPref.getValues();
for (int i = 0; i < entries.length; i++)
if (currentEntryValues.contains(entryValues[i]))
currentEntries.add(entries[i].toString());
p.setSummary(currentEntries.toString());
}
}