4 Reasons I’m Not Using Android Data Binding
Miquel Beltran
47519

Adding presentation logic on the layout.
<TextView
android:text="@{user.lastName}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="@{user.isAdult ? View.VISIBLE : View.GONE}"/>

Instead of android:visibility = …long logic..

you can probably set it to a simple property of the View Model, and keep the logic in the View Model. For example:

<TextView
android:text="@{user.lastName}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="@{user.isVisibile}"/>
Add Lambda expressions on the listeners.

Same argument right? We can keep the layout(XML) really simple ?

For example

android:onLongClick="@{handler.onLongClick}"

Despite the fact that Android Data Binding library allows, I wouldn’t put any logic in the layout, only properties of the View Model. Like you, I prefer to keep logic in the code.

Finally

I can develop things faster

Sorry, this is where I should agree with you but I have to beg to differ. For me it seems like it takes more effort to get all the setups completed. Especially with the current state of Android Studio, it seems to take longer.

Other than that I agree with you about other points such as Unit Testing.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.