File tree 2 files changed +14
-4
lines changed
subs/compose/src/main/java/com/engineer/compose 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,13 @@ fun DemoCard() {
32
32
var list by remember { mutableStateOf(ArrayList <String >()) }
33
33
val list2 = remember { mutableStateListOf<String >() }
34
34
val list3 = remember { mutableStateListOf(" " ) }
35
+ val count1 = { mutableIntStateOf(0 ) }
36
+ val count2 = { mutableStateOf(0 ) }
35
37
var list4 = remember { mutableStateOf(ArrayList <String >())}
36
38
39
+
40
+
41
+
37
42
Log .i(TAG ," count -> ${count::class } " )
38
43
Log .i(TAG ," list -> ${list::class } " )
39
44
Log .i(TAG ," list2 -> ${list2::class } " )
Original file line number Diff line number Diff line change @@ -6,14 +6,19 @@ class Delegate {
6
6
operator fun getValue (thisRef : Any? , property : KProperty <* >): String {
7
7
return " $thisRef , thank you for delegating '${property.name} ' to me!"
8
8
}
9
+
9
10
operator fun setValue (thisRef : Any? , property : KProperty <* >, value : String ) {
10
11
println (" $value has been assigned to '${property.name} ' in $thisRef ." )
11
12
}
12
13
}
13
14
15
+ class People {
16
+ var name by Delegate ()
17
+ }
18
+
14
19
fun main () {
15
- var p by Delegate ()
16
- println (p )
17
- p = " hello "
18
- println (p )
20
+ val people = People ()
21
+ println (people.name )
22
+ people.name = " mike "
23
+ println (people.name )
19
24
}
You can’t perform that action at this time.
0 commit comments