Skip to content

Commit c6109c8

Browse files
committed
update
1 parent 4972545 commit c6109c8

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.hoc081098.kotlin_playground.compose
2+
3+
import androidx.compose.foundation.layout.Column
4+
import androidx.compose.material.Button
5+
import androidx.compose.material.Text
6+
import androidx.compose.runtime.Composable
7+
import androidx.compose.ui.window.singleWindowApplication
8+
9+
fun main() {
10+
singleWindowApplication {
11+
MyComposable()
12+
}
13+
}
14+
15+
fun func1() {
16+
println("Func 1")
17+
}
18+
19+
fun func2(i: Int) {
20+
println("Func 2: $i")
21+
}
22+
23+
@Composable
24+
fun MyComposable() {
25+
val func3 = {
26+
println("Func 3")
27+
}
28+
val func4 = { i: Int ->
29+
println("Func 4: $i")
30+
}
31+
32+
Column {
33+
Button(onClick = ::func1) {
34+
Text("Func 1")
35+
}
36+
Button(onClick = { func2(1) }) {
37+
Text("Func 2")
38+
}
39+
Button(onClick = func3) {
40+
Text("Func 3")
41+
}
42+
Button(onClick = { func4(1) }) {
43+
Text("Func 4")
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)