androidx.preference.Preference.setOnPreferenceChangeListener()方法的使用及代码示例

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

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

Preference.setOnPreferenceChangeListener介绍

暂无

代码示例

代码示例来源:origin: proninyaroslav/libretorrent

private void bindOnPreferenceChangeListener(Preference preference)
{
  preference.setOnPreferenceChangeListener(this);
}

代码示例来源:origin: proninyaroslav/libretorrent

private void bindOnPreferenceChangeListener(Preference preference)
{
  preference.setOnPreferenceChangeListener(this);
}

代码示例来源:origin: proninyaroslav/libretorrent

private void bindOnPreferenceChangeListener(Preference preference)
{
  preference.setOnPreferenceChangeListener(this);
}

代码示例来源:origin: proninyaroslav/libretorrent

private void bindOnPreferenceChangeListener(Preference preference)
{
  preference.setOnPreferenceChangeListener(this);
}

代码示例来源:origin: proninyaroslav/libretorrent

private void bindOnPreferenceChangeListener(Preference preference)
{
  preference.setOnPreferenceChangeListener(this);
}

代码示例来源:origin: proninyaroslav/libretorrent

private void bindOnPreferenceChangeListener(Preference preference)
{
  preference.setOnPreferenceChangeListener(this);
}

代码示例来源:origin: proninyaroslav/libretorrent

private void bindOnPreferenceChangeListener(Preference preference)
{
  preference.setOnPreferenceChangeListener(this);
}

代码示例来源:origin: proninyaroslav/libretorrent

private void bindOnPreferenceChangeListener(Preference preference)
{
  preference.setOnPreferenceChangeListener(this);
}

代码示例来源:origin: bfabiszewski/ulogger-android

/**
 * Set various listeners
 */
private void setListeners() {
  final Preference prefLiveSync = findPreference(KEY_LIVE_SYNC);
  final Preference prefUsername = findPreference(KEY_USERNAME);
  final Preference prefPass = findPreference(KEY_PASS);
  final Preference prefHost = findPreference(KEY_HOST);
  // on change listeners
  if (prefLiveSync != null) {
    prefLiveSync.setOnPreferenceChangeListener(liveSyncChanged);
  }
  if (prefUsername != null) {
    prefUsername.setOnPreferenceChangeListener(serverSetupChanged);
  }
  if (prefPass != null) {
    prefPass.setOnPreferenceChangeListener(serverSetupChanged);
  }
  if (prefHost != null) {
    prefHost.setOnPreferenceChangeListener(serverSetupChanged);
  }
  // on click listeners
  if (prefUsername != null) {
    prefUsername.setOnPreferenceClickListener(serverSetupClicked);
  }
  if (prefHost != null) {
    prefHost.setOnPreferenceClickListener(serverSetupClicked);
  }
}

代码示例来源:origin: michael-rapp/AndroidMaterialDialog

/**
 * Initializes the preference, which allows to specfify, whether dialogs should be shown
 * fullscreen, or not.
 */
private void initializeFullscreenPreference() {
  Preference fullscreenPreference =
      findPreference(getString(R.string.fullscreen_preference_key));
  fullscreenPreference.setOnPreferenceChangeListener(createThemeChangeListener());
}

代码示例来源:origin: michael-rapp/AndroidMaterialDialog

/**
 * Initializes the preference, which allows to change the app's theme.
 */
private void initializeThemePreference() {
  Preference themePreference = findPreference(getString(R.string.theme_preference_key));
  themePreference.setOnPreferenceChangeListener(createThemeChangeListener());
}

代码示例来源:origin: michael-rapp/AndroidMaterialPreferences

/**
 * Initializes the preference, which allows to change the app's theme.
 */
private void initializeThemePreference() {
  Preference themePreference = findPreference(getString(R.string.theme_preference_key));
  themePreference.setOnPreferenceChangeListener(createThemeChangeListener());
}

代码示例来源:origin: michael-rapp/AndroidPreferenceActivity

@Override
public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {
  addPreferencesFromResource(R.xml.behavior_preferences);
  Preference overrideBackButtonPreference =
      findPreference(getString(R.string.override_navigation_icon_preference_key));
  overrideBackButtonPreference
      .setOnPreferenceChangeListener(createOverrideBackButtonChangeListener());
  Preference hideNavigationPreference =
      findPreference(getString(R.string.hide_navigation_preference_key));
  hideNavigationPreference
      .setOnPreferenceChangeListener(createHideNavigationChangeListener());
}

代码示例来源:origin: michael-rapp/AndroidPreferenceActivity

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
  addPreferencesFromResource(R.xml.appearance_preferences);
  Preference themePreference = findPreference(getString(R.string.theme_preference_key));
  themePreference.setOnPreferenceChangeListener(createThemeChangeListener());
  Preference toolbarElevationPreference =
      findPreference(getString(R.string.toolbar_elevation_preference_key));
  toolbarElevationPreference
      .setOnPreferenceChangeListener(createToolbarElevationChangeListener());
  Preference navigationWidthPreference =
      findPreference(getString(R.string.navigation_width_preference_key));
  navigationWidthPreference
      .setOnPreferenceChangeListener(createNavigationWidthChangeListener());
  Preference preferenceScreenElevationPreference =
      findPreference(getString(R.string.preference_screen_elevation_preference_key));
  preferenceScreenElevationPreference
      .setOnPreferenceChangeListener(createPreferenceScreenElevationChangeListener());
  Preference breadCrumbElevationPreference =
      findPreference(getString(R.string.bread_crumb_elevation_preference_key));
  breadCrumbElevationPreference
      .setOnPreferenceChangeListener(createBreadCrumbElevationChangeListener());
  Preference wizardButtonBarElevationPreference =
      findPreference(getString(R.string.wizard_button_bar_elevation_preference_key));
  wizardButtonBarElevationPreference
      .setOnPreferenceChangeListener(createWizardButtonBarElevationChangeListener());
  Preference preferenceFragmentButtonBarElevationPreference = findPreference(
      getString(R.string.preference_fragment_button_bar_elevation_preference_key));
  preferenceFragmentButtonBarElevationPreference.setOnPreferenceChangeListener(
      createPreferenceFragmentButtonBarElevationChangeListener());
}

代码示例来源:origin: morogoku/MTweaks-KernelAdiutorMOD

findPreference(KEY_UPDATE_NOTIFICATION).setOnPreferenceChangeListener(this);
findPreference(KEY_CHECK_UPDATE).setOnPreferenceClickListener(this);
findPreference(KEY_DARK_THEME).setOnPreferenceChangeListener(this);
findPreference(KEY_BANNER_RESIZER).setOnPreferenceClickListener(this);
findPreference(KEY_HIDE_BANNER).setOnPreferenceChangeListener(this);
findPreference(KEY_PRIMARY_COLOR).setOnPreferenceClickListener(this);
findPreference(KEY_ACCENT_COLOR).setOnPreferenceClickListener(this);
findPreference(KEY_SECTIONS_ICON).setOnPreferenceChangeListener(this);
findPreference(KEY_APPLY_ON_BOOT_TEST).setOnPreferenceClickListener(this);
findPreference(KEY_LOGCAT).setOnPreferenceClickListener(this);

代码示例来源:origin: 8enet/AppOpsX

.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
   @Override
   public boolean onPreferenceChange(Preference preference, Object newValue) {
mUseAdb.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
 @Override
 public boolean onPreferenceChange(Preference preference, Object newValue) {

代码示例来源:origin: michael-rapp/AndroidMaterialPreferences

findPreference(getString(R.string.show_value_as_summary_preference_key));
showValueAsSummaryPreference
    .setOnPreferenceChangeListener(createShowValueAsSummaryListener());
showDialogHeaderPreference.setOnPreferenceChangeListener(createShowDialogHeaderListener());
    .setOnPreferenceChangeListener(createShowDialogButtonBarDividerListener());

相关文章