Skip to content

A fully functional Android app built entirely with Kotlin and Jetpack Compose

Rename highlightSelectedTopic to shouldHighlightSelectedTopic

Alex Vanyofc418fc7a5a0
diff --git a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt
index 579240852..c0f425c65 100644
--- a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt
+++ b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt
@@ -168,7 +168,7 @@ internal fun InterestsListDetailScreen(
) {
InterestsRoute(
onTopicClick = ::onTopicClickShowDetailPane,
- highlightSelectedTopic = listDetailNavigator.isDetailPaneVisible(),
+ shouldHighlightSelectedTopic = listDetailNavigator.isDetailPaneVisible(),
)
}
}
diff --git a/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsScreen.kt b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsScreen.kt
index 75283942d..9b18ac89b 100644
--- a/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsScreen.kt
+++ b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsScreen.kt
@@ -38,7 +38,7 @@ import com.google.samples.apps.nowinandroid.core.ui.TrackScreenViewEvent
fun InterestsRoute(
onTopicClick: (String) -> Unit,
modifier: Modifier = Modifier,
- highlightSelectedTopic: Boolean = false,
+ shouldHighlightSelectedTopic: Boolean = false,
viewModel: InterestsViewModel = hiltViewModel(),
) {
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
@@ -50,7 +50,7 @@ fun InterestsRoute(
viewModel.onTopicClick(it)
onTopicClick(it)
},
- highlightSelectedTopic = highlightSelectedTopic,
+ shouldHighlightSelectedTopic = shouldHighlightSelectedTopic,
modifier = modifier,
)
}
@@ -61,7 +61,7 @@ internal fun InterestsScreen(
followTopic: (String, Boolean) -> Unit,
onTopicClick: (String) -> Unit,
modifier: Modifier = Modifier,
- highlightSelectedTopic: Boolean = false,
+ shouldHighlightSelectedTopic: Boolean = false,
) {
Column(
modifier = modifier,
@@ -79,7 +79,7 @@ internal fun InterestsScreen(
onTopicClick = onTopicClick,
onFollowButtonClick = followTopic,
selectedTopicId = uiState.selectedTopicId,
- highlightSelectedTopic = highlightSelectedTopic,
+ shouldHighlightSelectedTopic = shouldHighlightSelectedTopic,
)
is InterestsUiState.Empty -> InterestsEmptyScreen()
diff --git a/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/TabContent.kt b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/TabContent.kt
index 715d61578..133c2bedd 100644
--- a/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/TabContent.kt
+++ b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/TabContent.kt
@@ -49,7 +49,7 @@ fun TopicsTabContent(
modifier: Modifier = Modifier,
withBottomSpacer: Boolean = true,
selectedTopicId: String? = null,
- highlightSelectedTopic: Boolean = false,
+ shouldHighlightSelectedTopic: Boolean = false,
) {
Box(
modifier = modifier
@@ -66,7 +66,7 @@ fun TopicsTabContent(
topics.forEach { followableTopic ->
val topicId = followableTopic.topic.id
item(key = topicId) {
- val isSelected = highlightSelectedTopic && topicId == selectedTopicId
+ val isSelected = shouldHighlightSelectedTopic && topicId == selectedTopicId
InterestsItem(
name = followableTopic.topic.name,
following = followableTopic.isFollowed,