Member-only story
RxJava meets Android Data Binding
Including code examples and working project
Probably every Android developer is using or at least heard about RxJava. Currently, there are lots of libraries that use the reactive approach, let RxPreferences, RxLocation, RxPermissions, RxWear, RxBinding serve as an example. But letâs go back to the beginning.
Here at Tango we are using RxJava in every Android project because it accelerates application development and helps us in the fight with callback hell. We have been successfully using the reactive approach with our custom made MVP framework and currently in all our new projects we are using it with MVVM design pattern. Unfortunately, some Android developers know RxJava only from examples which show how to implement GitHub repositories browser using Retrofit. However, RxJava is doing great in situations when we are dealing with data or event streams which can be really useful in combination with Android Data Binding. Letâs focus on the code below.
There is the binding expression in line #4 which set enabled attribute to true|false dependingâ¦