ViewBindingPropertyDelegate icon indicating copy to clipboard operation
ViewBindingPropertyDelegate copied to clipboard

Crash in DialogFragment. ID does not reference a View inside this View

Open SwiftyWang opened this issue 3 years ago • 7 comments

I am using this library 1.4.5 version. With this function public inline fun <F : Fragment, T : ViewBinding> Fragment.viewBinding( crossinline vbFactory: (View) -> T, @IdRes viewBindingRootId: Int ) And working in activity and fragment. When using in DialogFragment. The app crash when I try to use viewBinding instance in onViewCreated callback. After some investigated, found the dialog contentView will be set in onActivityCreated which is called after onViewCreated. But the delegate will get the view from dialog inside.

Is that a bug? Please give some suggestions, thanks.

SwiftyWang avatar Apr 09 '21 08:04 SwiftyWang