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
fun main() { | |
print("foo ") | |
print("bar"); | |
// prints: foo bar | |
} |
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
// simplified. | |
fun main() { | |
print("foo ") | |
print("bar"); | |
// prints: foo bar | |
} |
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
fun main() { | |
print("foo ") | |
bar { | |
print("bar"); | |
} | |
// prints: foo bar | |
} | |
inline fun bar(invoke: () -> Unit) { | |
invoke() |
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
fun main() { | |
print("foo ") | |
bar() | |
// prints: foo bar | |
} | |
inline fun bar() { | |
print("bar") | |
} |
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 | |
inline fun Row( | |
modifier: Modifier = Modifier, | |
horizontalArrangement: Arrangement.Horizontal = Arrangement.Start, | |
verticalAlignment: Alignment.Vertical = Alignment.Top, | |
content: @Composable RowScope.() -> Unit | |
) { | |
// implementation details | |
} |
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 MyRow(content: @Composable () -> Unit) { | |
content() | |
} | |
@Composable | |
fun Sample() { | |
var button1 by remember { mutableStateOf("button 1") } | |
Column(horizontalAlignment = Alignment.CenterHorizontally) { |
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 Sample() { | |
var button1 by remember { mutableStateOf("button 1") } | |
var button2 by remember { mutableStateOf("button 2") } | |
Column(horizontalAlignment = Alignment.CenterHorizontally) { | |
Button(onClick = { button1 += "1" }) { Text(text = button1) } | |
Spacer(modifier = Modifier.height(8.dp)) |
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 Sample() { | |
var button1 by remember { mutableStateOf("button 1") } | |
var button2 by remember { mutableStateOf("button 2") } | |
Column(horizontalAlignment = Alignment.CenterHorizontally) { | |
// Recomposes when `button1` changes, but not when button2 changes | |
Button(onClick = { button1 += "1" }) { Text(text = button1) } | |
Spacer(modifier = Modifier.height(8.dp)) |
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 | |
private fun SimpleTextField() { | |
var text by remember { mutableStateOf("") } | |
TextField(value = text, onValueChange = { | |
text = it | |
}) | |
} |
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
resource "aws_ecs_task_definition" "my_simple_task" { | |
family = "my-task" | |
container_definitions = <<DEFINITION | |
[ | |
{ | |
// other configurations | |
"memory": 512, | |
"cpu": 256 | |
} | |
] |
NewerOlder