Rename highlightSelectedTopic to shouldHighlightSelectedTopic

Change-Id: I5869404bc66d878030faf1ae2d5b95cc27ce67b4
pull/1642/head
Alex Vanyo 6 months ago
parent 77c0d6c500
commit fc418fc7a5
No known key found for this signature in database

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

@ -38,7 +38,7 @@ import com.google.samples.apps.nowinandroid.core.ui.TrackScreenViewEvent
fun InterestsRoute( fun InterestsRoute(
onTopicClick: (String) -> Unit, onTopicClick: (String) -> Unit,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
highlightSelectedTopic: Boolean = false, shouldHighlightSelectedTopic: Boolean = false,
viewModel: InterestsViewModel = hiltViewModel(), viewModel: InterestsViewModel = hiltViewModel(),
) { ) {
val uiState by viewModel.uiState.collectAsStateWithLifecycle() val uiState by viewModel.uiState.collectAsStateWithLifecycle()
@ -50,7 +50,7 @@ fun InterestsRoute(
viewModel.onTopicClick(it) viewModel.onTopicClick(it)
onTopicClick(it) onTopicClick(it)
}, },
highlightSelectedTopic = highlightSelectedTopic, shouldHighlightSelectedTopic = shouldHighlightSelectedTopic,
modifier = modifier, modifier = modifier,
) )
} }
@ -61,7 +61,7 @@ internal fun InterestsScreen(
followTopic: (String, Boolean) -> Unit, followTopic: (String, Boolean) -> Unit,
onTopicClick: (String) -> Unit, onTopicClick: (String) -> Unit,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
highlightSelectedTopic: Boolean = false, shouldHighlightSelectedTopic: Boolean = false,
) { ) {
Column( Column(
modifier = modifier, modifier = modifier,
@ -79,7 +79,7 @@ internal fun InterestsScreen(
onTopicClick = onTopicClick, onTopicClick = onTopicClick,
onFollowButtonClick = followTopic, onFollowButtonClick = followTopic,
selectedTopicId = uiState.selectedTopicId, selectedTopicId = uiState.selectedTopicId,
highlightSelectedTopic = highlightSelectedTopic, shouldHighlightSelectedTopic = shouldHighlightSelectedTopic,
) )
is InterestsUiState.Empty -> InterestsEmptyScreen() is InterestsUiState.Empty -> InterestsEmptyScreen()

@ -49,7 +49,7 @@ fun TopicsTabContent(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
withBottomSpacer: Boolean = true, withBottomSpacer: Boolean = true,
selectedTopicId: String? = null, selectedTopicId: String? = null,
highlightSelectedTopic: Boolean = false, shouldHighlightSelectedTopic: Boolean = false,
) { ) {
Box( Box(
modifier = modifier modifier = modifier
@ -66,7 +66,7 @@ fun TopicsTabContent(
topics.forEach { followableTopic -> topics.forEach { followableTopic ->
val topicId = followableTopic.topic.id val topicId = followableTopic.topic.id
item(key = topicId) { item(key = topicId) {
val isSelected = highlightSelectedTopic && topicId == selectedTopicId val isSelected = shouldHighlightSelectedTopic && topicId == selectedTopicId
InterestsItem( InterestsItem(
name = followableTopic.topic.name, name = followableTopic.topic.name,
following = followableTopic.isFollowed, following = followableTopic.isFollowed,

Loading…
Cancel
Save