setVisibleIfNull

fun View.setVisibleIfNull(instance: Any?)

Sets the visibility of the View based on whether the instance is null. If the instance is null, the visibility is set to View.VISIBLE. If the instance is not null, it is set to View.GONE.

This adapter allows replacing

<View
android:visibility="@{viewModel.instance == null ? View.VISIBLE : View.GONE}" />

with

<View
auto:visibleIfNull="@{viewModel.instance}" />