Skip to content

Instantly share code, notes, and snippets.

@Foso
Created November 1, 2019 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Foso/08b5a29f4fd896dcd09e719790f39434 to your computer and use it in GitHub Desktop.
Save Foso/08b5a29f4fd896dcd09e719790f39434 to your computer and use it in GitHub Desktop.
@Composable
fun TextView(text: String) {
val context = +ambient(ContextAmbient)
Text(text)
}
@Composable
fun SimpleTextView(){
TextView("Desgin")
}
enum class Orientation {
HORIZONTAL, VERTICAL
}
@Composable
fun LinearLayout(
android_orientation: Orientation = HORIZONTAL,
block: @Composable() FlexScope.() -> Unit
) {
when (android_orientation) {
VERTICAL -> {
Column {
block()
}
}
HORIZONTAL -> {
Row {
block()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment