Tushar
10/11/2024, 5:06 PMinit {
itemView.setOnClickListener {
onItemClicked(bindingAdapterPosition)
}
}
will it evaluate the value of bindingAdapterPosition
at the time of calling the init{}
or when a click happens. Moreover would love to know how actually lambda works deep downCLOVIS
10/11/2024, 5:07 PMMichael Krussel
10/11/2024, 6:09 PMTushar
10/11/2024, 6:25 PMMichael Krussel
10/11/2024, 6:29 PMTools -> Kotlin -> Show Kotlin Byte Code
.Tushar
10/11/2024, 6:45 PMCLOVIS
10/11/2024, 7:14 PMShould show you how it gets converted to an anonymous class.That's only true if you use Java 6 or 7. If you target later versions, it should use proper Java lambdas.
Michael Krussel
10/11/2024, 7:14 PMMichael Krussel
10/11/2024, 7:14 PMCLOVIS
10/11/2024, 7:15 PMIf it does, then what the purpose of decompiling to java rather than kotlin, isn't kotlin independent of java (except jvm)?Yes, it's just that IntelliJ has been able to decompile any bytecode to Java for literal decades now. Since decompiling is just about understanding what some code does, there's not much need for a Kotlin decompiler (and it's hard to write one!) so IntellIiJ just has a Java decompiler
CLOVIS
10/11/2024, 7:16 PMTushar
10/11/2024, 7:26 PMCLOVIS
10/11/2024, 7:26 PMWout Werkman
10/15/2024, 7:46 PM