Package-level declarations

Types

Link copied to clipboard
class ActivityViewBindingProperty<in A : ComponentActivity, out V : ViewBinding>(viewBinder: (A) -> V) : LifecycleViewBindingProperty<A, V>
Link copied to clipboard
class DialogFragmentViewBindingProperty<in F : DialogFragment, out V : ViewBinding>(viewBinder: (F) -> V) : LifecycleViewBindingProperty<F, V>
Link copied to clipboard
class FragmentViewBindingProperty<in F : Fragment, out V : ViewBinding>(viewBinder: (F) -> V) : LifecycleViewBindingProperty<F, V>
Link copied to clipboard
open class LazyViewBindingProperty<in R : Any, out V : ViewBinding>(val viewBinder: (R) -> V) : ViewBindingProperty<R, V>
Link copied to clipboard
abstract class LifecycleViewBindingProperty<in R : Any, out V : ViewBinding>(val viewBinder: (R) -> V) : ViewBindingProperty<R, V>
Link copied to clipboard
interface ViewBindingProperty<in R : Any, out V : ViewBinding> : ReadOnlyProperty<R, V>

Functions

Link copied to clipboard
fun findRootView(activity: Activity): View
Link copied to clipboard
fun DialogFragment.getRootView(viewBindingRootId: Int): View
Link copied to clipboard
private fun <VB : ViewBinding> reflectViewBinding(current: Class<*>, layoutInflater: LayoutInflater, base: Class<*>?): VB

Creates an instance of the binding class for the activity to use.

private fun <VB : ViewBinding> reflectViewBinding(current: Class<*>, view: View, base: Class<*>?): VB
private fun <VB : ViewBinding> reflectViewBinding(current: Class<*>, from: LayoutInflater, container: ViewGroup?, base: Class<*>?): VB

Creates an instance of the binding class for the fragment to use.

Link copied to clipboard
@JvmName(name = "reflexViewBindingActivity")
fun <I : Activity, O : ViewBinding> I.reflectViewBinding(base: Class<I>? = null): O

Creates an instance of the binding class for the activity to use.

@JvmName(name = "reflexViewBindingFragment")
fun <I : Fragment, O : ViewBinding> I.reflectViewBinding(base: Class<I>? = null): O
@JvmName(name = "reflexViewBindingFragment")
fun <I : Fragment, O : ViewBinding> I.reflectViewBinding(container: ViewGroup?, base: Class<I>? = null): O

Creates an instance of the binding class for the fragment to use.

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "viewBindingActivity")
inline fun <V : ViewBinding> Activity.viewBinding(crossinline viewBinder: (LayoutInflater) -> V): LazyViewBindingProperty<Activity, V>

Creates an instance of the binding class for the Activity to use.

@JvmName(name = "viewBindingActivity")
inline fun <V : ViewBinding> ComponentActivity.viewBinding(crossinline viewBinder: (LayoutInflater) -> V): ActivityViewBindingProperty<ComponentActivity, V>

Creates an instance of the binding class for the ComponentActivity to use. ActivityViewBindingProperty will call ActivityViewBindingProperty.clear to clear ViewBinding when the lifecycle of current activity is Lifecycle.State.DESTROYED to prevent memory leaks.

@JvmName(name = "viewBindingViewGroup")
inline fun <V : ViewBinding> ViewGroup.viewBinding(crossinline viewBinder: (View) -> V, crossinline viewProvider: (ViewGroup) -> View = { this }): LazyViewBindingProperty<ViewGroup, V>
@JvmName(name = "viewBindingViewGroup")
inline fun <V : ViewBinding> ViewGroup.viewBinding(crossinline viewBinder: (View) -> V, @IdRes viewBindingRootId: Int): LazyViewBindingProperty<ViewGroup, V>

Creates an instance of the binding class for the ViewGroup to use.

@JvmName(name = "viewBindingActivity")
inline fun <V : ViewBinding> ComponentActivity.viewBinding(crossinline viewBinder: (View) -> V, crossinline viewProvider: (ComponentActivity) -> View = ::findRootView): ActivityViewBindingProperty<ComponentActivity, V>
@JvmName(name = "viewBindingActivity")
inline fun <V : ViewBinding> ComponentActivity.viewBinding(crossinline viewBinder: (View) -> V, @IdRes viewBindingRootId: Int): ActivityViewBindingProperty<ComponentActivity, V>

Creates an instance of the binding class for the ComponentActivity to use.

@JvmName(name = "viewBindingFragment")
inline fun <F : Fragment, V : ViewBinding> Fragment.viewBinding(crossinline viewBinder: (View) -> V, crossinline viewProvider: (F) -> View = Fragment::requireView): ViewBindingProperty<F, V>
@JvmName(name = "viewBindingFragment")
inline fun <F : Fragment, V : ViewBinding> Fragment.viewBinding(crossinline viewBinder: (View) -> V, @IdRes viewBindingRootId: Int): ViewBindingProperty<F, V>

Creates an instance of the binding class for the Fragment to use.

@JvmName(name = "viewBindingViewHolder")
inline fun <V : ViewBinding> RecyclerView.ViewHolder.viewBinding(crossinline viewBinder: (View) -> V, crossinline viewProvider: (RecyclerView.ViewHolder) -> View = RecyclerView.ViewHolder::itemView): LazyViewBindingProperty<RecyclerView.ViewHolder, V>
@JvmName(name = "viewBindingViewHolder")
inline fun <V : ViewBinding> RecyclerView.ViewHolder.viewBinding(crossinline viewBinder: (View) -> V, @IdRes viewBindingRootId: Int): LazyViewBindingProperty<RecyclerView.ViewHolder, V>

Creates an instance of the binding class for the RecyclerView.ViewHolder to use.