Last active
June 13, 2019 23:51
-
-
Save ValeryPonomarenko/8161f039a0708074c6396ba30f56da12 to your computer and use it in GitHub Desktop.
Rendering a Screen Based On Its ViewState
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viewModel.viewState.observe(this) { | |
when (it) { | |
is SearchViewState.Entering -> { | |
text_destination_from.text = it.from.name | |
text_small_from.text = it.from.shortName | |
text_destination_to.text = it.to.name | |
text_small_to.text = it.to.shortName | |
} | |
is SearchViewState.Loaded -> { | |
adapter.flights = it.flights | |
adapter.notifyDataSetChanged() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment