setVisibleIfNot
Sets the visibility of the View based on whether the condition is satisfied. If the condition is unsatisfied (false
) or null
, the visibility is set to View.VISIBLE. Otherwise, it is set to View.GONE.
This adapter allows replacing
<View
android:visibility="@{viewModel.condition ? View.GONE : View.VISIBLE}" />
Content copied to clipboard
with
<View
auto:visibleIfNot="@{viewModel.condition}" />
Content copied to clipboard