Android Extensions plugin now generates synthetic properties for Activity
, Fragment
and View
receiver types. I think you can use the base view in your custom components:
class MyComponent(val baseView: View) {
val firstName = baseView.firstName
val lastName = baseView.lastName
}
Note to import the kotlinx.android.synthetic.<variantName>.<layoutName>.view
package contents.
Also, there is a KEEP for supporting user holder classes, and the prototype is almost done. See Android Extensions: View holder pattern support and caching options by yanex · Pull Request #33 · Kotlin/KEEP · GitHub for more details.