本文整理匯總了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());
}
}