File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed
viewbinding-ktx/src/main/java/com/dylanc/viewbinding
viewbinding-nonreflection-ktx/src/main/java/com/dylanc/viewbinding/nonreflection Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ class FragmentBindingProperty<VB : ViewBinding>(private val clazz: Class<VB>) :
4141 if (binding is ViewDataBinding ) binding.lifecycleOwner = thisRef.viewLifecycleOwner
4242 }
4343 } catch (e: IllegalStateException ) {
44- throw IllegalStateException (" The binding property has been destroyed." )
44+ throw IllegalStateException (" The property of ${ property.name} has been destroyed." )
4545 }
4646}
4747
@@ -55,7 +55,7 @@ class FragmentInflateBindingProperty<VB : ViewBinding>(private val clazz: Class<
5555 binding = (clazz.getMethod(" inflate" , LayoutInflater ::class .java).invoke(null , thisRef.layoutInflater) as VB )
5656 .also { binding -> if (binding is ViewDataBinding ) binding.lifecycleOwner = thisRef.viewLifecycleOwner }
5757 } catch (e: IllegalStateException ) {
58- throw IllegalStateException (" The binding property has been destroyed." )
58+ throw IllegalStateException (" The property of ${ property.name} has been destroyed." )
5959 }
6060 thisRef.viewLifecycleOwner.lifecycle.addObserver(object : DefaultLifecycleObserver {
6161 override fun onDestroy (owner : LifecycleOwner ) {
Original file line number Diff line number Diff line change 1919package com.dylanc.viewbinding
2020
2121import android.view.LayoutInflater
22- import android.view.View
2322import android.view.ViewGroup
2423import androidx.viewbinding.ViewBinding
2524
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class FragmentBindingDelegate<VB : ViewBinding>(private val bind: (View) -> VB)
3939 if (binding is ViewDataBinding ) binding.lifecycleOwner = thisRef.viewLifecycleOwner
4040 }
4141 } catch (e: IllegalStateException ) {
42- throw IllegalStateException (" The binding property has been destroyed." )
42+ throw IllegalStateException (" The property of ${ property.name} has been destroyed." )
4343 }
4444 return binding
4545 }
@@ -55,7 +55,7 @@ class FragmentInflateBindingDelegate<VB : ViewBinding>(private val inflate: (Lay
5555 if (binding is ViewDataBinding ) binding.lifecycleOwner = thisRef.viewLifecycleOwner
5656 }
5757 } catch (e: IllegalStateException ) {
58- throw IllegalStateException (" The binding property has been destroyed." )
58+ throw IllegalStateException (" The property of ${ property.name} has been destroyed." )
5959 }
6060 thisRef.viewLifecycleOwner.lifecycle.addObserver(object : DefaultLifecycleObserver {
6161 override fun onDestroy (owner : LifecycleOwner ) {
You can’t perform that action at this time.
0 commit comments