spotless fixes

Change-Id: I5ca91db033a658450144439e90ea4b880f57b7fd
feature/list-detail-pane-scaffold
Jonathan Koren 10 months ago
parent 05bdcd217e
commit 80d7a5ed08

@ -23,7 +23,7 @@ import com.google.samples.apps.nowinandroid.core.data.repository.UserDataReposit
import com.google.samples.apps.nowinandroid.core.domain.GetFollowableTopicsUseCase
import com.google.samples.apps.nowinandroid.core.domain.TopicSortField
import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic
import com.google.samples.apps.nowinandroid.feature.interests.navigation.topicIdArg
import com.google.samples.apps.nowinandroid.feature.interests.navigation.TOPIC_ID_ARG
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
@ -40,7 +40,7 @@ class InterestsViewModel @Inject constructor(
) : ViewModel() {
val uiState: StateFlow<InterestsUiState> = combine(
savedStateHandle.getStateFlow<String?>(topicIdArg, null),
savedStateHandle.getStateFlow<String?>(TOPIC_ID_ARG, null),
getFollowableTopics(sortBy = TopicSortField.NAME),
InterestsUiState::Interests,
).stateIn(
@ -57,7 +57,7 @@ class InterestsViewModel @Inject constructor(
fun onTopicClick(topicId: String) {
viewModelScope.launch {
savedStateHandle[topicIdArg] = topicId
savedStateHandle[TOPIC_ID_ARG] = topicId
}
}
}

@ -25,8 +25,7 @@ import androidx.navigation.navArgument
import com.google.samples.apps.nowinandroid.feature.interests.InterestsRoute
internal const val topicIdArg = "topicId"
//const val interestsRoute = "interests_route?$topicIdArg={$topicIdArg}"
internal const val TOPIC_ID_ARG = "topicId"
const val INTERESTS_ROUTE = "interests_route"
fun NavController.navigateToInterestsGraph(
@ -36,7 +35,7 @@ fun NavController.navigateToInterestsGraph(
if (topicId == null) {
navigate(INTERESTS_ROUTE, navOptions)
} else {
navigate("$INTERESTS_ROUTE?$topicIdArg=$topicId", navOptions)
navigate("$INTERESTS_ROUTE?$TOPIC_ID_ARG=$topicId", navOptions)
}
}
@ -46,7 +45,7 @@ fun NavGraphBuilder.interestsGraph(
composable(
route = INTERESTS_ROUTE,
arguments = listOf(
navArgument(topicIdArg) {
navArgument(TOPIC_ID_ARG) {
defaultValue = null
nullable = true
},

Loading…
Cancel
Save