Tagged: DataBinding

0

Android Databinding – Variable is already defined

Recently I added a listener variable in the layout XML of one of my files. It looked like this: <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android"> <data> <variable name="paymentActionListener" type="com.tideaccount.android.tabs.accounts.listeners.QueuedPaymentActionListener" /> </data> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="5dp"...

0

Context in Android Databinding XML files

It is so easy guys, just don’t forget that DataBinding creates a field called context which you can access by default in your XML file. So you can write something like this:   <data>...

0

Don’t let BindingAdapters kill CustomViews!

What are BindingAdapters? Google introduced the DataBinding library. It is a great project which eliminates dependencies like ButterKnife and couples directly your View  model with the GUI you are building. They also introduced the...