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
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>) :
41
41
if (binding is ViewDataBinding ) binding.lifecycleOwner = thisRef.viewLifecycleOwner
42
42
}
43
43
} catch (e: IllegalStateException ) {
44
- throw IllegalStateException (" The binding property has been destroyed." )
44
+ throw IllegalStateException (" The property of ${ property.name} has been destroyed." )
45
45
}
46
46
}
47
47
@@ -55,7 +55,7 @@ class FragmentInflateBindingProperty<VB : ViewBinding>(private val clazz: Class<
55
55
binding = (clazz.getMethod(" inflate" , LayoutInflater ::class .java).invoke(null , thisRef.layoutInflater) as VB )
56
56
.also { binding -> if (binding is ViewDataBinding ) binding.lifecycleOwner = thisRef.viewLifecycleOwner }
57
57
} catch (e: IllegalStateException ) {
58
- throw IllegalStateException (" The binding property has been destroyed." )
58
+ throw IllegalStateException (" The property of ${ property.name} has been destroyed." )
59
59
}
60
60
thisRef.viewLifecycleOwner.lifecycle.addObserver(object : DefaultLifecycleObserver {
61
61
override fun onDestroy (owner : LifecycleOwner ) {
Original file line number Diff line number Diff line change 19
19
package com.dylanc.viewbinding
20
20
21
21
import android.view.LayoutInflater
22
- import android.view.View
23
22
import android.view.ViewGroup
24
23
import androidx.viewbinding.ViewBinding
25
24
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class FragmentBindingDelegate<VB : ViewBinding>(private val bind: (View) -> VB)
39
39
if (binding is ViewDataBinding ) binding.lifecycleOwner = thisRef.viewLifecycleOwner
40
40
}
41
41
} catch (e: IllegalStateException ) {
42
- throw IllegalStateException (" The binding property has been destroyed." )
42
+ throw IllegalStateException (" The property of ${ property.name} has been destroyed." )
43
43
}
44
44
return binding
45
45
}
@@ -55,7 +55,7 @@ class FragmentInflateBindingDelegate<VB : ViewBinding>(private val inflate: (Lay
55
55
if (binding is ViewDataBinding ) binding.lifecycleOwner = thisRef.viewLifecycleOwner
56
56
}
57
57
} catch (e: IllegalStateException ) {
58
- throw IllegalStateException (" The binding property has been destroyed." )
58
+ throw IllegalStateException (" The property of ${ property.name} has been destroyed." )
59
59
}
60
60
thisRef.viewLifecycleOwner.lifecycle.addObserver(object : DefaultLifecycleObserver {
61
61
override fun onDestroy (owner : LifecycleOwner ) {
You can’t perform that action at this time.
0 commit comments