Package 

Class EnvPickerKt

  • All Implemented Interfaces:

    
    public final class EnvPickerKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • 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 object
        context - 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 key
        fragmentTitle - displayed as title of fragment
        defaultEntries - will be set as initial values if no entries are present at init time
        defaultActiveEntry - will be set as initial active entry
        context - 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 key
        fragmentTitle - displayed as title of fragment
        fieldNames - the names of the fields associated with the Entry
        defaultEntries - will be set as initial values if no entries are present at init time
        defaultActiveEntry - will be set as initial active entry
        context - to be used to access SharedPreferences and resources