Skip to content

2.3.0

Compare
Choose a tag to compare
@consp1racy consp1racy released this 27 Jul 12:32
· 9 commits to 2.x since this release

Support Preference

  • FIXED: Properly disable long click listener so a selector doesn't appear on passive items.
  • FIXED: SeekBarPreference now properly registers and unregisters its key listener.
  • FIXED: SeekBarPreference info text view no longer leaks the activity context.
  • FIXED: MultiSelectListPreference persistence:
    • Storing a new value now correctly overwrites any currently persisted value.
      Previously it could throw a ClassCastException.
    • Reading now correctly throws a ClassCastException if stored value is not a Set<String>.
    • PreferenceDataStore is now supported.
  • FIXED: The library is now compatible with Android P preview.
    • RingtonePreference dialog shows ringtones.
    • XpAppCompatSpinner doesn't crash.
  • FIXED: SeekBarPreference now treats null default value as zero.
  • FIXED: TwoStatePreference now treats null default value as false.
  • FIXED: CheckBoxPreference now correctly reverts check box state if preference change listener returned false.
  • FIXED: Added missing implementation in deprecated method XpPreferenceHelpers#setDialogIcon.
  • NEW! New API for using a long-lived themed context with the preference fragment.
    • This will prevent memory leaks when using retained preference fragments. Retained fragments
      don't reinflate the preference hierarchy on each configuration change which prevents jank.
    • Override XpPreferenceFragment#onProvideCustomStyledContext and return an application context
      with an activity theme overlay. Use utility methods in the StyledContextProvider class.
  • NEW! Preference theme with text aligned with activity title.
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Asp.Material.Inset</item>
<!-- Add if you use ColorPreference. -->
<item name="colorPreferenceStyle">
    @style/Preference.Asp.Material.Inset.DialogPreference.ColorPreference
</item>

Support Spinner

  • FIXED: Revised logic for sizing and positioning of popup windows. See behavior changes.
    Popups should now correctly show when not using ListPreference or underlined Spinner.
  • FIXED: Drop down indicator now has consistent position in plain and underlined Spinner.
    See behavior changes.

API Changes

  • While binary compatibility is maintained, nullability annotations were added everywhere.

Behavior Changes

  • Popup grow animation has been replaced with Material fade in animation on Android 4.
    This looks better since the popup and selected item are now displayed precisely over
    the emitting view. If you want the previous behavior put this code in your styles.xml:
<style name="Base.Widget.Asp.ListPopupWindow" parent="Widget.AppCompat.ListPopupWindow">
    <item name="android:popupAnimationStyle">@style/Animation.Asp.Popup.Holo</item>
</style>
  • Since the logic for sizing and positioning popup windows now actually works,
    you may need to revise any hacks you used to precisely position your XpListPopupWindows.
  • Notes on drop down indicator of XpAppCompatSpinner:
    • The indicator is 10dp wide.
    • The indicator is now 8dp from text and 6dp from view bounds (was 15dp and 7dp respectively).
    • The underlined background includes extra 4dp inset on left and right sides.
    • If you want the previous behavior (bigger space between text and indicator) set both
      android:paddingEnd and android:paddingRight to 32dp (plain) or 36dp (underlined).