Last active
March 1, 2021 15:47
-
-
Save raulh82vlc/1e410bd07974f4e27cd61eb88dd535a0 to your computer and use it in GitHub Desktop.
StateUIValue with all other UI states
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
@Composable | |
fun StateUIValue(uiState: TweetsUIState) { | |
when (uiState) { | |
is TweetsUIState.ListResultsUIState -> TweetList(tweets = uiState.tweets) | |
is TweetsUIState.LoadingUIState -> CenteredText(msg = stringResource(R.string.loading_feed)) | |
is TweetsUIState.EmptyUIState -> CenteredText(msg = stringResource(R.string.query, uiState.query)) | |
is TweetsUIState.ErrorUIState -> CenteredText(msg = ”Error happened: $uiState.msg”) | |
is TweetsUIState.InitialIdleUIState -> TopText() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment