File tree Expand file tree Collapse file tree 5 files changed +8
-8
lines changed
app/src/main/java/com/google/samples/apps/nowinandroid
common/src/main/java/com/google/samples/apps/nowinandroid/core/result
ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui
foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou
interests/src/main/java/com/google/samples/apps/nowinandroid/feature/interests Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,6 @@ class MainActivityViewModel @Inject constructor(
4343}
4444
4545sealed interface MainActivityUiState {
46- object Loading : MainActivityUiState
46+ data object Loading : MainActivityUiState
4747 data class Success (val userData : UserData ) : MainActivityUiState
4848}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import kotlinx.coroutines.flow.onStart
2424sealed interface Result <out T > {
2525 data class Success <T >(val data : T ) : Result<T>
2626 data class Error (val exception : Throwable ? = null ) : Result<Nothing>
27- object Loading : Result<Nothing>
27+ data object Loading : Result <Nothing >
2828}
2929
3030fun <T > Flow<T>.asResult (): Flow <Result <T >> {
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ sealed interface NewsFeedUiState {
112112 /* *
113113 * The feed is still loading.
114114 */
115- object Loading : NewsFeedUiState
115+ data object Loading : NewsFeedUiState
116116
117117 /* *
118118 * The feed is loaded with the given list of news resources.
Original file line number Diff line number Diff line change @@ -25,17 +25,17 @@ sealed interface OnboardingUiState {
2525 /* *
2626 * The onboarding state is loading.
2727 */
28- object Loading : OnboardingUiState
28+ data object Loading : OnboardingUiState
2929
3030 /* *
3131 * The onboarding state was unable to load.
3232 */
33- object LoadFailed : OnboardingUiState
33+ data object LoadFailed : OnboardingUiState
3434
3535 /* *
3636 * There is no onboarding state.
3737 */
38- object NotShown : OnboardingUiState
38+ data object NotShown : OnboardingUiState
3939
4040 /* *
4141 * There is a onboarding state, with the given lists of topics.
Original file line number Diff line number Diff line change @@ -53,11 +53,11 @@ class InterestsViewModel @Inject constructor(
5353}
5454
5555sealed interface InterestsUiState {
56- object Loading : InterestsUiState
56+ data object Loading : InterestsUiState
5757
5858 data class Interests (
5959 val topics : List <FollowableTopic >,
6060 ) : InterestsUiState
6161
62- object Empty : InterestsUiState
62+ data object Empty : InterestsUiState
6363}
You can’t perform that action at this time.
0 commit comments