Version 1.1.0-alpha05

May 7, 2019

androidx.preference:preference:1.1.0-alpha05 and androidx.preference:preference-ktx:1.1.0-alpha05 are released. The commits included in this version can be found here.

New features

  • Updated the styling for unselectable Preferences - the title and summary now share the same color to make it clear that they cannot be interacted with, and are only used for displaying information.
  • Note: you may want to consider adding enableCopying="true" to your unselectable Preferences, so you can long press to copy the summary.

Bug fixes

  • Fixed a regression where PreferenceCategory and other unselectable Preferences would have a ripple effect when selected
  • Fixed an accessibility issue where TalkBack did not see DropDownPreference as clickable
  • Fixed some RTL layout issues
  • Updated some nullable annotations in PreferenceFragmentCompat to match Fragment

Version 1.1.0-alpha04

March 13, 2019

androidx.preference:preference:1.1.0-alpha04 and androidx.preference:preference-ktx:1.1.0-alpha04 are released. The full list of commits included in this version can be found here.

New features

The SeekBarPreference update!

  • Styling updated to match Material Specifications
    • The value label is now hidden by default although it can still be shown with app:showSeekBarValue="true" or setShowSeekBarValue(true). This label is not part of Material spec, but we understand that it is heavily used so we will continue to support it - even though we don’t recommend using it.
    • The value label now updates while the SeekBar is being dragged, instead of when it is released. Note that this does not mean that the value internally is updated, see below for a new API that enables that functionality.
    • Note: Although it is supported, you should avoid setting a summary on a SeekBarPreference, as it is not intended and not part of the Material spec.
  • Adds support for continuous updates, allowing the SeekBar to update its saved value while the SeekBar is being dragged. This can be enabled from XML or programmatically, with app:updatesContinuously="true" or setUpdatesContinuously(true). This will fire whenever the SeekBar’s position on screen changes.

API changes

  • Adds missing nullability annotations to findPreference()

Bug fixes

  • Fixed a bug where context menu listeners were not being correctly removed if copying is not enabled

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.