Created
November 1, 2019 09:44
-
-
Save Foso/08b5a29f4fd896dcd09e719790f39434 to your computer and use it in GitHub Desktop.
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
@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