|
|
@ -62,6 +62,7 @@ import androidx.compose.material3.Text
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.LaunchedEffect
|
|
|
|
import androidx.compose.runtime.LaunchedEffect
|
|
|
|
import androidx.compose.runtime.getValue
|
|
|
|
import androidx.compose.runtime.getValue
|
|
|
|
|
|
|
|
import androidx.compose.runtime.remember
|
|
|
|
import androidx.compose.ui.Alignment
|
|
|
|
import androidx.compose.ui.Alignment
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.graphics.toArgb
|
|
|
|
import androidx.compose.ui.graphics.toArgb
|
|
|
@ -109,12 +110,15 @@ internal fun ForYouRoute(
|
|
|
|
val isSyncing by viewModel.isSyncing.collectAsStateWithLifecycle()
|
|
|
|
val isSyncing by viewModel.isSyncing.collectAsStateWithLifecycle()
|
|
|
|
val deepLinkedUserNewsResource by viewModel.deepLinkedNewsResource.collectAsStateWithLifecycle()
|
|
|
|
val deepLinkedUserNewsResource by viewModel.deepLinkedNewsResource.collectAsStateWithLifecycle()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val onTopicCheckedChangedRem: (String, Boolean) -> Unit =
|
|
|
|
|
|
|
|
remember { viewModel::updateTopicSelection }
|
|
|
|
|
|
|
|
|
|
|
|
ForYouScreen(
|
|
|
|
ForYouScreen(
|
|
|
|
isSyncing = isSyncing,
|
|
|
|
isSyncing = isSyncing,
|
|
|
|
onboardingUiState = onboardingUiState,
|
|
|
|
onboardingUiState = onboardingUiState,
|
|
|
|
feedState = feedState,
|
|
|
|
feedState = feedState,
|
|
|
|
deepLinkedUserNewsResource = deepLinkedUserNewsResource,
|
|
|
|
deepLinkedUserNewsResource = deepLinkedUserNewsResource,
|
|
|
|
onTopicCheckedChanged = viewModel::updateTopicSelection,
|
|
|
|
onTopicCheckedChanged = onTopicCheckedChangedRem,
|
|
|
|
onDeepLinkOpened = viewModel::onDeepLinkOpened,
|
|
|
|
onDeepLinkOpened = viewModel::onDeepLinkOpened,
|
|
|
|
onTopicClick = onTopicClick,
|
|
|
|
onTopicClick = onTopicClick,
|
|
|
|
saveFollowedTopics = viewModel::dismissOnboarding,
|
|
|
|
saveFollowedTopics = viewModel::dismissOnboarding,
|
|
|
@ -259,9 +263,9 @@ private fun LazyGridScope.onboarding(
|
|
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
TopicSelection(
|
|
|
|
TopicSelection(
|
|
|
|
onboardingUiState,
|
|
|
|
onboardingUiState = onboardingUiState,
|
|
|
|
onTopicCheckedChanged,
|
|
|
|
onTopicCheckedChanged = onTopicCheckedChanged,
|
|
|
|
Modifier.padding(bottom = 8.dp),
|
|
|
|
modifier = Modifier.padding(bottom = 8.dp),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
// Done button
|
|
|
|
// Done button
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|