Example project of building a MVVM-based Android app using Data Binding
Java
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea
app
gradle/wrapper
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

This is an example app which use data binding to illustrate a dynamic and inter-dependent GUI.

image

  • UI elements are hidden/shown dependent on the radio button states
  • There is delayed loading of data ("# of logged in users") which illustrate network requests and async UI update

Originally written as support code for the blog post named Android Databinding: Goodbye Presenter, Hello Viewmodel!. See tags mvp and mvvm referred to by that post.

Later expanded upon to include a more complete Databinding example with full two-way databinding of EditText-fields at the two-way-implicit tag, or manual read-back if you prefer that by the two-way-explicit tag.

The final addition is viewmodel retention upon device rotation in later commits of branch two-way, and also experimentation with using the LiveData and ViewModelProviders classes of the Android Architecture Components tool box in the branch androidarch