Skip to content

This is an example of Android's new Data Binding Library showing how to have a two way communiction. Normally, Data BInding only works from the Object to layout and not Vice-Versa. Eg- If two EditTexts are bind to the same class object, updating object's value from one EditText should automatically show updated value in second EditText. But this…

License

Notifications You must be signed in to change notification settings

rohankandwal/Android-Data-Binding-2-way-communication

Repository files navigation

Android Marshmallow 6.0 Data Binding with two way communication

This is an example of Android's new Data Binding Library showing how to have a two way communiction. Normally, Data BInding only works from the Object to layout and not Vice-Versa. Eg- If two EditTexts are bind to the same class object, updating object's value from one EditText should automatically show updated value in second EditText. But this doesn't happens, the values in EditText are only updated when using a "set" method. Further changes to the class's object are not reflected in the layout. However, if we use two way binding, then changes made in one EditText will automatically be updated in second EditText, since they are both using same object.

Alt text

See an example on Android Marshmallow 6.0 Data Binding with RecycleView @ https://github.com/rohankandwal/Marshmallow-Databinding-w-RecyclerView

Login form w/ validation through data binding https://github.com/rohankandwal/LoginFormW-DataBinding

About

This is an example of Android's new Data Binding Library showing how to have a two way communiction. Normally, Data BInding only works from the Object to layout and not Vice-Versa. Eg- If two EditTexts are bind to the same class object, updating object's value from one EditText should automatically show updated value in second EditText. But this…

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages