Skip to content

Latest commit

 

History

History
35 lines (33 loc) · 924 Bytes

README.md

File metadata and controls

35 lines (33 loc) · 924 Bytes

AndroidX Preference Extensions

Android library: Extensions of AndroidX Preference.

Usage

  1. Add dependency through JitPack.
  2. XML
<PreferenceScreen>
    ...
    <EditTextPreferencePlus
        android:hint="hint"
        android:inputType="number"
        android:maxLength="4"
        app:formatSummary="true"
        app:key="edittext"
        app:summary="text is %s!"
        app:title="edittext" />
    ...
    <NumberPickerPreference
        app:formatSummary="true"
        app:key="numberpicker"
        app:maxValue="20"
        app:minValue="10"
        app:summary="%s sheep"
        app:title="numberpicker"
        app:wrapSelectorWheel="true" />
    ...
</PreferenceScreen>
  1. Fragment
import crazyboyfeng.android.preference.PreferenceFragmentCompat;
class MyPreferenceFragment extends PreferenceFragmentCompat {}