Skip to content

Instantly share code, notes, and snippets.

@juliuscanute
Last active May 31, 2020 02:56
Show Gist options
  • Save juliuscanute/3a0edffe97b94ca8ab2b1853c8389841 to your computer and use it in GitHub Desktop.
Save juliuscanute/3a0edffe97b94ca8ab2b1853c8389841 to your computer and use it in GitHub Desktop.
Android MultiConfigure Get
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val config = MultiConfigure.getConfig()
val colorConfig = config.getConfigPair("D")
setContent {
MaterialTheme {
Greeting(
text = config.getConfigString("C"),
visibility = config.getConfigBoolean("A"),
style = TextStyle(
fontSize = Sp(config.getConfigInt("B").toFloat()),
color = when (colorConfig.second) {
0 -> Color.Red
1 -> Color.Green
else -> Color.Blue
}
)
)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment