-
- All Implemented Interfaces:
-
androidx.lifecycle.LifecycleEventObserver,androidx.lifecycle.LifecycleObserver,kotlin.properties.ReadOnlyProperty
public final class ActivityViewBindingDelegate<VB extends ViewBinding> implements ReadOnlyProperty<AppCompatActivity, VB>, LifecycleEventObserver
Creates and manages a ViewBinding object from within an AppCompatActivity. The value will be cleared when the AppCompatActivity reaches the "destroyed" lifecycle state.
-
-
Constructor Summary
Constructors Constructor Description ActivityViewBindingDelegate(AppCompatActivity activity, Function1<LayoutInflater, VB> viewBindingFactory)
-
Method Summary
Modifier and Type Method Description UnitonStateChanged(LifecycleOwner source, Lifecycle.Event event)VBgetValue(AppCompatActivity thisRef, KProperty<?> property)Returns the ViewBinding object. -
-
Constructor Detail
-
ActivityViewBindingDelegate
ActivityViewBindingDelegate(AppCompatActivity activity, Function1<LayoutInflater, VB> viewBindingFactory)
-
-
Method Detail
-
onStateChanged
Unit onStateChanged(LifecycleOwner source, Lifecycle.Event event)
-
getValue
VB getValue(AppCompatActivity thisRef, KProperty<?> property)
Returns the ViewBinding object.
-
-
-
-