Last active
May 31, 2020 02:56
-
-
Save juliuscanute/3a0edffe97b94ca8ab2b1853c8389841 to your computer and use it in GitHub Desktop.
Android MultiConfigure Get
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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