Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hoc081098 committed Sep 20, 2024
1 parent c6109c8 commit e338f2c
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions src/main/kotlin/com/hoc081098/kotlin_playground/compose/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,44 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.window.singleWindowApplication

fun main() {
val demo = Demo()
singleWindowApplication {
MyComposable()
demo.MyComposable()
}
}

fun func1() {
println("Func 1")
}

fun func2(i: Int) {
println("Func 2: $i")
}

@Composable
fun MyComposable() {
val func3 = {
println("Func 3")
class Demo {
private fun func1() {
println("Func 1")
}
val func4 = { i: Int ->
println("Func 4: $i")

private fun func2(i: Int) {
println("Func 2: $i")
}

Column {
Button(onClick = ::func1) {
Text("Func 1")
}
Button(onClick = { func2(1) }) {
Text("Func 2")
@Composable
fun MyComposable() {
val func3 = {
println("Func 3")
}
Button(onClick = func3) {
Text("Func 3")
val func4 = { i: Int ->
println("Func 4: $i")
}
Button(onClick = { func4(1) }) {
Text("Func 4")

Column {
Button(onClick = ::func1) {
Text("Func 1")
}
Button(onClick = { func2(1) }) {
Text("Func 2")
}
Button(onClick = func3) {
Text("Func 3")
}
Button(onClick = { func4(1) }) {
Text("Func 4")
}
}
}

}

0 comments on commit e338f2c

Please sign in to comment.