-
public final class PreferenceScreenBuilder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classPreferenceScreenBuilder.CustomPreferenceBuilderBuilder for custom preference. Calling title is required to add PreferenceScreen.
-
Constructor Summary
Constructors Constructor Description PreferenceScreenBuilder(Context context, PreferenceGroup rootScreen, KotprefModel model)
-
Method Summary
Modifier and Type Method Description final UnitdependsOn(Preference $self, Preference preference)Add dependency to other Preference final SwitchPreferenceCompatswitch(KProperty0<Boolean> property, String title, Function1<SwitchPreferenceCompat, Unit> options)Create SwitchPreferenceCompat with provided property final CheckBoxPreferencecheckBox(KProperty0<Boolean> property, String title, Function1<CheckBoxPreference, Unit> options)Create CheckBoxPreference with provided property final EditTextPreferenceeditText(KProperty0<String> property, String title, Function1<EditTextPreference, Unit> options)Create EditTextPreference with provided property final DropDownPreferencedropDown(KProperty0<String> property, String title, Function1<DropDownPreference, Unit> options)Create DropDownPreference with provided property final ListPreferencelist(KProperty0<String> property, String title, Function1<ListPreference, Unit> options)Create ListPreference with provided property final MultiSelectListPreferencemultiSelectList(KProperty0<Set<String>> property, String title, Function1<MultiSelectListPreference, Unit> options)Create MultiSelectListPreference with provided property final SeekBarPreferenceseekBar(KProperty0<Integer> property, String title, Function1<SeekBarPreference, Unit> options)Create SeekBarPreference with provided property final Preferencepreference(String key, String title, Function1<Preference, Unit> options)Create Preference final PreferenceCategorycategory(String title, Function1<PreferenceScreenBuilder, Unit> childBuilder)Create PreferenceCategory final PreferenceScreenscreen(String title, Function1<PreferenceScreen, Unit> options)Create PreferenceScreen final <T extends Preference> PreferenceScreenBuilder.CustomPreferenceBuilder<T>with(T $self, KProperty0<Object> property)Start builder adding custom preference into PreferenceScreen CustomPreference(context) .with(it::customValue) .title("Custom preference") { setCustomParam(param) }-
-
Constructor Detail
-
PreferenceScreenBuilder
PreferenceScreenBuilder(Context context, PreferenceGroup rootScreen, KotprefModel model)
-
-
Method Detail
-
dependsOn
final Unit dependsOn(Preference $self, Preference preference)
Add dependency to other Preference
-
switch
final SwitchPreferenceCompat switch(KProperty0<Boolean> property, String title, Function1<SwitchPreferenceCompat, Unit> options)
Create SwitchPreferenceCompat with provided property
-
checkBox
final CheckBoxPreference checkBox(KProperty0<Boolean> property, String title, Function1<CheckBoxPreference, Unit> options)
Create CheckBoxPreference with provided property
-
editText
final EditTextPreference editText(KProperty0<String> property, String title, Function1<EditTextPreference, Unit> options)
Create EditTextPreference with provided property
-
dropDown
final DropDownPreference dropDown(KProperty0<String> property, String title, Function1<DropDownPreference, Unit> options)
Create DropDownPreference with provided property
-
list
final ListPreference list(KProperty0<String> property, String title, Function1<ListPreference, Unit> options)
Create ListPreference with provided property
-
multiSelectList
final MultiSelectListPreference multiSelectList(KProperty0<Set<String>> property, String title, Function1<MultiSelectListPreference, Unit> options)
Create MultiSelectListPreference with provided property
-
seekBar
final SeekBarPreference seekBar(KProperty0<Integer> property, String title, Function1<SeekBarPreference, Unit> options)
Create SeekBarPreference with provided property
-
preference
final Preference preference(String key, String title, Function1<Preference, Unit> options)
Create Preference
-
category
final PreferenceCategory category(String title, Function1<PreferenceScreenBuilder, Unit> childBuilder)
Create PreferenceCategory
- Parameters:
title- category titlechildBuilder- PreferenceScreenBuilder to create Preference in this category
-
screen
final PreferenceScreen screen(String title, Function1<PreferenceScreen, Unit> options)
Create PreferenceScreen
-
with
final <T extends Preference> PreferenceScreenBuilder.CustomPreferenceBuilder<T> with(T $self, KProperty0<Object> property)
Start builder adding custom preference into PreferenceScreen
CustomPreference(context) .with(it::customValue) .title("Custom preference") { setCustomParam(param) }- Parameters:
property- property to associate this custom preference
-
-
-
-