Skip to content

Instantly share code, notes, and snippets.

@JoseAlcerreca
Created April 26, 2018 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoseAlcerreca/45f1e8fcc10faa7fdc8b797f83d8636d to your computer and use it in GitHub Desktop.
Save JoseAlcerreca/45f1e8fcc10faa7fdc8b797f83d8636d to your computer and use it in GitHub Desktop.
class ListViewModel : ViewModel {
private val _navigateToDetails = MutableLiveData<Boolean>()
val navigateToDetails : LiveData<Boolean>
get() = _navigateToDetails
fun userClicksOnButton() {
_navigateToDetails.value = true
}
fun navigateToDetailsHandled() {
_navigateToDetails.value = false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment