<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="android.view.View" />
<variable
name="notificationResponse"
type="myms.models.NotificationResponse"/>
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
...........
<TextView
android:id="@+id/tv_empty_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/_12dp"
android:layout_marginRight="@dimen/_12dp"
android:minHeight="@dimen/_60dp"
android:gravity="center"
android:textSize="@dimen/_18sp"
android:textStyle="bold"
android:text="No Message"
android:background="@color/white"
android:visibility="@{notificationResponse.payloads.size() > 0 ? View.GONE : View.VISIBLE}"/>
......
</FrameLayout>
</layout>
What i want to achieve is that by default the view should be GONE and after the async call in my code where i actually bind the notificationResponse object it should decide whether to show or hide the view.