Skip to content

Commit

Permalink
fix the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
REBOOTERS committed Nov 23, 2024
1 parent 72e6174 commit 3eee77f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ fun DemoCard() {
var list by remember { mutableStateOf(ArrayList<String>()) }
val list2 = remember { mutableStateListOf<String>() }
val list3 = remember { mutableStateListOf("") }
val count1 = { mutableIntStateOf(0) }
val count2 = { mutableStateOf(0) }
var list4 = remember { mutableStateOf(ArrayList<String>())}




Log.i(TAG,"count -> ${count::class}")
Log.i(TAG,"list -> ${list::class}")
Log.i(TAG,"list2 -> ${list2::class}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ class Delegate {
operator fun getValue(thisRef: Any?, property: KProperty<*>): String {
return "$thisRef, thank you for delegating '${property.name}' to me!"
}

operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {
println("$value has been assigned to '${property.name}' in $thisRef.")
}
}

class People {
var name by Delegate()
}

fun main() {
var p by Delegate()
println(p)
p = "hello"
println(p)
val people = People()
println(people.name)
people.name = "mike"
println(people.name)
}

0 comments on commit 3eee77f

Please sign in to comment.