From the course: Android Development: Data Binding
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Overview of observables - Android Tutorial
From the course: Android Development: Data Binding
Overview of observables
- [Instructor] Up until now, we've been using a regular class to hold the data that we've been binding to in our layouts. Now, the downside of using regular data classes is that when data in the class changes, the layout doesn't automatically get notified of the change so it can update its fields. If you want the data in the layout to update in response to changes within the model, then you have to have some type of observable data model. In this chapter, we're going to look at two different ways of creating observable data models. So the first uses the framework-provided observable classes, such as ObservableField, ObservableInt and some others. The second method involves binding data directly to the ViewModel architecture components using LiveData, which are an improvement over observables since they are lifecycle-aware components. We're also going to see how to create BindingAdapters which can be used to adapt data within the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Overview of observables1m 51s
-
(Locked)
Binding to observables4m 49s
-
(Locked)
Binding to ViewModels6m 25s
-
(Locked)
Using binding adapters7m 19s
-
(Locked)
Two-way binding syntax4m 45s
-
(Locked)
Using converters4m 2s
-
(Locked)
Challenge: Color binding adapter1m 18s
-
(Locked)
Solution: Color binding adapter2m 26s
-
(Locked)
-