Preference

Version 1.1.0-alpha03

February 7, 2019

androidx.preference:preference 1.1.0-alpha03

androidx.preference:preference 1.1.0-alpha03 and androidx.preference:preference-ktx 1.1.0-alpha03 are released with the following changes.

Bug fixes

  • Fixed an issue where the copy/paste popup would sometimes not show in EditTextPreference’s dialog
  • Fixed an issue where the underlying adapter was not unregistered properly, causing memory leaks under specific conditions (b/121006469)
  • Fixed some dialog related crashes that occurred during configuration change (b/122167543)
  • Fixed SummaryProvider not working for MultiSelectListPreference (b/123022772)

Version 1.1.0-alpha02

December 17, 2018

Please also check out the recently updated Settings guide and sample app.

New features

  • Added EditTextPreference.OnBindEditTextListener interface This allows customizing the EditText displayed in the corresponding dialog after the dialog has been bound. For example, setting a custom input type / length or adding a TextWatcher.

  • Added Preference.setCopyingEnabled() When set, long pressing on the Preference will show a context menu that allows copying the summary of the Preference. This can be used to allow copying of static information such as user-specific IDs / application version information.

  • preferenceTheme is now applied to the activity theme This means that when creating a Preference from code, you no longer need to use the context from PreferenceManager#getContext() - you can just use your Fragment/Activity context.

API changes

  • Refactored findPreference() to return <T extends Preference> This means that you do not need to explicitly cast Preferences when using findPreference(). For example, EditTextPreference preference = findPreference(“edit_text”) is now valid code.

Version 1.1.0-alpha01

November 5, 2018

New features

  • You can now set a SummaryProvider on a Preference to dynamically configure its summary whenever the Preference is updated, or becomes visible to the user.
  • Added default SummaryProvider implementations for ListPreference and EditTextPreference, which when set will automatically update the summary of the Preference to reflect its saved value, or ‘Not Set’ if no value has been saved. These can be set with app:useSimpleSummaryProvider=”true”
  • Added PreferenceGroup#removePreferenceRecursively which recursively finds and removes a Preference from the group, or a nested group lower down in the hierarchy.

API changes

  • PreferenceFragment and other classes using framework Fragments have been deprecated - you should use PreferenceFragmentCompat and other compat classes instead.

Bug fixes

  • Fixed iconSpaceReserved not working correctly with PreferenceCategories.
  • Fixed PreferenceCategories not using colorAccent for their title’s color below API 21.
  • Fixed some SeekBarPreference layout inconsistencies below API 21.