<ImageView
android:id="@+id/quality_three_image"
...
android:onClick="@{() -> viewModel.onSetSleepQuality(3)}"
...
app:srcCompat="@drawable/ic_sleep_3" />
android:enabled
ColorStateList
https://developer.android.com/guide/topics/resources/color-list-resource
StateListDrawable
https://developer.android.com/guide/topics/resources/drawable-resource#StateList
<!-- android:id="@+id/start_button" -->
android:enabled="@{sleepTrackerViewModel.startButtonVisible}"
<!-- android:id="@+id/stop_button" -->
android:enabled="@{sleepTrackerViewModel.stopButtonVisible}"
<!-- android:id="@+id/clear_button" -->
android:enabled="@{sleepTrackerViewModel.clearButtonVisible}"
Snackbar
https://material.io/components/snackbars/android#using-snackbars
Learn more
Navigation
https://developer.android.com/topic/libraries/architecture/navigation/
Designing Back and Up navigation
https://developer.android.com/training/design-navigation/ancestral-temporal
Snackbar
https://material.io/develop/android/components/snackbar/SUMMARY
Triggering navigation
Setting the android:enabled attribute
Other points covered in this codelab