diff --git a/docs/ArchitectureLearningJourney.md b/docs/ArchitectureLearningJourney.md index dd0715028..1a5112058 100644 --- a/docs/ArchitectureLearningJourney.md +++ b/docs/ArchitectureLearningJourney.md @@ -276,7 +276,7 @@ View models receive streams of data as cold [flows](https://kotlin.github.io/kot **Example: Displaying followed topics and authors** -The `FollowingViewModel` exposes `uiState` as a `StateFlow`. This hot flow is created by combining four data streams: +The `InterestsViewModel` exposes `uiState` as a `StateFlow`. This hot flow is created by combining four data streams: @@ -287,7 +287,7 @@ The `FollowingViewModel` exposes `uiState` as a `StateFlow`. T The list of `Author`s is mapped to a new list of `FollowableAuthor`s. `FollowableAuthor` is a wrapper for `Author` which also indicates whether the current user is following that author. The same transformation is applied for the list of `Topic`s. -The two new lists are used to create a `FollowingUiState.Interests` state which is exposed to the UI. +The two new lists are used to create a `InterestsUiState.Interests` state which is exposed to the UI. ### Processing user interactions @@ -296,7 +296,7 @@ User actions are communicated from UI elements to view models using regular meth **Example: Following a topic** -The `FollowingScreen` takes a lambda expression named `followTopic` which is supplied from `FollowingViewModel.followTopic`. Each time the user taps on a topic to follow this method is called. The view model then processes this action by informing the topics repository. +The `InterestsScreen` takes a lambda expression named `followTopic` which is supplied from `InterestsViewModel.followTopic`. Each time the user taps on a topic to follow this method is called. The view model then processes this action by informing the topics repository. ## Further reading diff --git a/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt b/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt index 1a03d2751..2ab82c054 100644 --- a/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt +++ b/feature-foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt @@ -50,8 +50,6 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Search import androidx.compose.material.icons.outlined.AccountCircle -import androidx.compose.material3.Button -import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme @@ -90,6 +88,7 @@ import com.google.samples.apps.nowinandroid.core.model.data.SaveableNewsResource import com.google.samples.apps.nowinandroid.core.model.data.Topic import com.google.samples.apps.nowinandroid.core.ui.LoadingWheel import com.google.samples.apps.nowinandroid.core.ui.NewsResourceCardExpanded +import com.google.samples.apps.nowinandroid.core.ui.component.NiaFilledButton import com.google.samples.apps.nowinandroid.core.ui.component.NiaGradientBackground import com.google.samples.apps.nowinandroid.core.ui.component.NiaToggleButton import com.google.samples.apps.nowinandroid.core.ui.component.NiaTopAppBar @@ -275,19 +274,15 @@ private fun LazyListScope.InterestsSelection( horizontalArrangement = Arrangement.Center, modifier = Modifier.fillMaxWidth() ) { - Button( + NiaFilledButton( onClick = saveFollowedTopics, enabled = interestsSelectionState.canSaveInterests, modifier = Modifier .padding(horizontal = 40.dp) - .width(364.dp), - colors = ButtonDefaults.buttonColors( - containerColor = MaterialTheme.colorScheme.onBackground - ) + .width(364.dp) ) { Text( - text = stringResource(R.string.done), - color = MaterialTheme.colorScheme.onPrimary + text = stringResource(R.string.done) ) } }