The data binding framework in Android makes use of the Observer pattern to allow for reactive programming. Any object that is referenced by a layout file that implements the Observable interface is watched, and when it signals that it has changed, the user interface updates accordingly. As the data binding system can be used on any attribute or setter of any widget, this means that you can control far more than just the content or state of the user interface. You can control whether widgets are visible or invisible, and you can control which image is used for the background of a widget. At its core, the Observer pattern looks like this:
In the Android Observer pattern, the data model classes expose themselves as Observable by implementing the android.databinding.Observable interface and notifying a list of event-listeners (observers) of any changes to their...