android.support.v7.preference.Preference.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中android.support.v7.preference.Preference.<init>()方法的一些代码示例,展示了Preference.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Preference.<init>()方法的具体详情如下:
包路径:android.support.v7.preference.Preference
类名称:Preference
方法名:<init>

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);
}

相关文章