Skip to content

Instantly share code, notes, and snippets.

@ahinchman1
Last active May 11, 2020 04:44
Show Gist options
  • Save ahinchman1/b429ee29c639a7391a599d16bd91ddae to your computer and use it in GitHub Desktop.
Save ahinchman1/b429ee29c639a7391a599d16bd91ddae to your computer and use it in GitHub Desktop.
sealed class MainActivityViewState {
object Loading : MainActivityViewState()
object Content : MainActivityViewState()
}
class MainActivityViewModel: ViewModel() {
private val _viewState = MutableLiveData<MainActivityViewState>()
val viewState: LiveData<MainActivityViewState> = _viewState
init {
_viewState.value = MainActivityViewState.Loading
loadContent()
}
private fun loadContent() {
navigator.navigateToInvasiveSpeciesMap()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment