本文整理了Java中android.support.v7.preference.Preference.<init>()
方法的一些代码示例,展示了Preference.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Preference.<init>()
方法的具体详情如下:
包路径:android.support.v7.preference.Preference
类名称:Preference
方法名:<init>
暂无
代码示例来源:origin: MoMoWait/LeanbackLauncher
public void onCreatePreferences(Bundle bundle, String s) {
Context preferenceContext = getPreferenceManager().getContext();
PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(preferenceContext);
screen.setTitle(R.string.settings_dialog_title);
this.mRecommendationsPref = new Preference(preferenceContext);
this.mRecommendationsPref.setTitle(R.string.recommendation_blacklist_action_title);
this.mRecommendationsPref.setFragment(RecommendationsPreferenceFragment.class.getName());
screen.addPreference(this.mRecommendationsPref);
Preference appsAndGames = new Preference(preferenceContext);
appsAndGames.setTitle(R.string.home_screen_order_action_title);
appsAndGames.setFragment(AppsAndGamesPreferenceFragment.class.getName());
screen.addPreference(appsAndGames);
setPreferenceScreen(screen);
}
代码示例来源:origin: MoMoWait/LeanbackLauncher
screen.removeAll();
screen.setOrderingAsAdded(false);
Preference preference = new Preference(context);
preference.setLayoutResource(R.layout.pref_wall_of_text);
preference.setSelectable(false);
代码示例来源:origin: LonamiWebs/Stringlate
String[] data = (_cu.readTextfileFromRawRes(R.raw.project_team, "", "").trim() + "\n\n").split("\n");
for (int i = 0; i + 2 < data.length; i += 4) {
Preference person = new Preference(context);
person.setTitle(data[i]);
person.setSummary(data[i + 1]);
代码示例来源:origin: MoMoWait/LeanbackLauncher
public void onCreatePreferences(Bundle bundle, String s) {
Context preferenceContext = getPreferenceManager().getContext();
PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(preferenceContext);
screen.setTitle(R.string.home_screen_order_content_title);
SortingModeManager.SortingMode sortingMode = SortingModeManager.getSavedSortingMode(preferenceContext);
SwitchPreference autoSort = new SwitchPreference(preferenceContext);
autoSort.setTitle(R.string.apps_order_pref_label);
autoSort.setOnPreferenceChangeListener(this);
autoSort.setChecked(sortingMode == SortingModeManager.SortingMode.RECENCY);
screen.addPreference(autoSort);
this.mReorderAppsPref = new Preference(preferenceContext);
this.mReorderAppsPref.setKey("reorderapps");
this.mReorderAppsPref.setTitle(R.string.customize_app_order_action_title);
screen.addPreference(this.mReorderAppsPref);
this.mReorderGamesPref = new Preference(preferenceContext);
this.mReorderGamesPref.setKey("reordergames");
this.mReorderGamesPref.setTitle(R.string.customize_game_order_action_title);
screen.addPreference(this.mReorderGamesPref);
updateSortingPreferenceVisibility(sortingMode);
setPreferenceScreen(screen);
}
内容来源于网络,如有侵权,请联系作者删除!