-
- All Implemented Interfaces:
public final class EnvPickerKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Entry> EnvPicker<T>envPicker(Config<T> config, Context context)Instantiates an EnvPicker that can be used to manage its data directly or create a Fragment that lets users manage the data via UI. final static EnvPicker<SimpleEntry>envPicker(String key, String fragmentTitle, List<SimpleEntry> defaultEntries, SimpleEntry defaultActiveEntry, Context context)A simple interface if only one String value needs to be stored per entry. final static EnvPicker<MultiEntry>envPicker(String key, String fragmentTitle, List<String> fieldNames, List<MultiEntry> defaultEntries, MultiEntry defaultActiveEntry, Context context)A simple interface for storing multiple String values per entry. -
-
Method Detail
-
envPicker
final static <T extends Entry> EnvPicker<T> envPicker(Config<T> config, Context context)
Instantiates an EnvPicker that can be used to manage its data directly or create a Fragment that lets users manage the data via UI.
For simple use cases there are two simplified overloads of the envPicker function. Use this version if you want to use a custom data class as Entry implementation.
- Parameters:
config- a valid Config objectcontext- to be used to access SharedPreferences and resources
-
envPicker
final static EnvPicker<SimpleEntry> envPicker(String key, String fragmentTitle, List<SimpleEntry> defaultEntries, SimpleEntry defaultActiveEntry, Context context)
A simple interface if only one String value needs to be stored per entry.
- Parameters:
key- used as SharedPreferences keyfragmentTitle- displayed as title of fragmentdefaultEntries- will be set as initial values if no entries are present at init timedefaultActiveEntry- will be set as initial active entrycontext- to be used to access SharedPreferences and resources
-
envPicker
final static EnvPicker<MultiEntry> envPicker(String key, String fragmentTitle, List<String> fieldNames, List<MultiEntry> defaultEntries, MultiEntry defaultActiveEntry, Context context)
A simple interface for storing multiple String values per entry. Accessing those values needs to be done via index, so using a custom data class implementing Entry might be advisable.
- Parameters:
key- used as SharedPreferences keyfragmentTitle- displayed as title of fragmentfieldNames- the names of the fields associated with the EntrydefaultEntries- will be set as initial values if no entries are present at init timedefaultActiveEntry- will be set as initial active entrycontext- to be used to access SharedPreferences and resources
-
-
-
-