StockVisibilityProvidingCompositeViewModel

open class StockVisibilityProvidingCompositeViewModel<T : VisibilityProvider>(viewModels: List<T>, isVisible: Boolean) : VisibilityProvidingCompositeViewModel<T>

A view model that holds multiple visible instances. By default, this instance is visible, when any of the held view models is visible.

This type facilitates convenient access to common operations from Android layouts through data binding. These utilities are normally accessed through extension functions, which cannot be used cleanly in the data binding syntax.

Parameters

viewModels

The view models that are held.

isVisible

Determines whether the instance should be visible or not.

Constructors

fun <T : VisibilityProvider> StockVisibilityProvidingCompositeViewModel(vararg viewModels: T)
fun <T : VisibilityProvider> StockVisibilityProvidingCompositeViewModel(viewModels: List<T>, isVisible: Boolean = viewModels.any { it.isVisible })

Properties

Link copied to clipboard
open override val isVisible: Boolean
Link copied to clipboard
override val viewModels: List<T>