Skip to content

Instantly share code, notes, and snippets.

@reactivedroid
Last active October 9, 2022 10:57
Show Gist options
  • Save reactivedroid/28d7f4b8b93499ebad96dd7a9c331c8d to your computer and use it in GitHub Desktop.
Save reactivedroid/28d7f4b8b93499ebad96dd7a9c331c8d to your computer and use it in GitHub Desktop.
Abstraction over [BuildConfig] for accessing its values
/**
* Abstraction over [BuildConfig] for accessing its values
*/
interface BuildConfigProvider {
/**
* Gets the configuration for the given [key]
*/
fun getValue(key: String): String
/**
* Sets the [selectedFlavor] as selected by the user eg: prod, staging
*/
fun setFlavor(selectedFlavor: String)
/**
* Return the [selectedFlavor] as selected by the user eg: prod, staging
*/
fun getFlavor(): String
/**
* Returns all the flavors as supported by the app
*/
fun allFlavors(): List<String>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment