private static void replaceAllCheckBoxPreferencesBySwitchPreferences(
final PreferenceGroup group) {
final ArrayList<Preference> preferences = new ArrayList<>();
final int count = group.getPreferenceCount();
for (int index = 0; index < count; index++) {
preferences.add(group.getPreference(index));
}
group.removeAll();
for (int index = 0; index < count; index++) {
final Preference preference = preferences.get(index);
if (preference instanceof CheckBoxPreference) {
addSwitchPreferenceBasedOnCheckBoxPreference((CheckBoxPreference)preference, group);
} else {
group.addPreference(preference);
if (preference instanceof PreferenceGroup) {
replaceAllCheckBoxPreferencesBySwitchPreferences((PreferenceGroup)preference);
}
}
}
}
TwoStatePreferenceHelper.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:simple-keyboard
作者:
评论列表
文章目录