androidbroadcast / ViewBindingPropertyDelegate

Make work with Android View Binding simpler
https://proandroiddev.com/make-android-view-binding-great-with-kotlin-b71dd9c87719
Apache License 2.0
1.42k stars 102 forks source link

Is it possible to provide support for viewBinding(ViewBinding::inflate) #120

Closed weijia1991 closed 7 months ago

weijia1991 commented 1 year ago

In a custom view, I would like to use viewBingding like below:

class ProfileView(context: Context) : LinearLayout(context) {

    private val viewBinding by viewBinding(ViewProfileBinding::inflate)
}
achatina commented 1 year ago

Is it so necessary for you? Just use ViewProfileBinding.inflate(LayoutInflater.from(context), this)

This lib was created for simplyfing work with lifecycle of viewBinding entities and soon as your view don't need to watch when fragment\activity died - you don't need it.

weijia1991 commented 1 year ago

I get. Thanks