Rename highlightSelectedTopic to shouldHighlightSelectedTopic

Change-Id: I5869404bc66d878030faf1ae2d5b95cc27ce67b4
pull/1837/head
Alex Vanyo 6 months ago
parent a0dbdc0307
commit 8b247926e2

@ -168,7 +168,7 @@ internal fun InterestsListDetailScreen(
) {
InterestsRoute(
onTopicClick = ::onTopicClickShowDetailPane,
highlightSelectedTopic = listDetailNavigator.isDetailPaneVisible(),
shouldHighlightSelectedTopic = listDetailNavigator.isDetailPaneVisible(),
)
}
}

@ -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()

@ -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,

Loading…
Cancel
Save