|
|
@ -17,6 +17,7 @@
|
|
|
|
package com.google.samples.apps.nowinandroid.feature.foryou
|
|
|
|
package com.google.samples.apps.nowinandroid.feature.foryou
|
|
|
|
|
|
|
|
|
|
|
|
import android.app.Activity
|
|
|
|
import android.app.Activity
|
|
|
|
|
|
|
|
import android.util.Log
|
|
|
|
import androidx.compose.animation.AnimatedVisibility
|
|
|
|
import androidx.compose.animation.AnimatedVisibility
|
|
|
|
import androidx.compose.animation.fadeIn
|
|
|
|
import androidx.compose.animation.fadeIn
|
|
|
|
import androidx.compose.animation.fadeOut
|
|
|
|
import androidx.compose.animation.fadeOut
|
|
|
@ -97,10 +98,13 @@ internal fun ForYouRoute(
|
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
viewModel: ForYouViewModel = hiltViewModel()
|
|
|
|
viewModel: ForYouViewModel = hiltViewModel()
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
|
|
val onboardingUiState by viewModel.onboardingUiState.collectAsStateWithLifecycle()
|
|
|
|
val onboardingUiState by viewModel.onboardingUiState.collectAsStateWithLifecycle()
|
|
|
|
val feedState by viewModel.feedState.collectAsStateWithLifecycle()
|
|
|
|
val feedState by viewModel.feedState.collectAsStateWithLifecycle()
|
|
|
|
val isSyncing by viewModel.isSyncing.collectAsStateWithLifecycle()
|
|
|
|
val isSyncing by viewModel.isSyncing.collectAsStateWithLifecycle()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.i("Caren", "Executing ForYouRoute: $feedState")
|
|
|
|
|
|
|
|
|
|
|
|
ForYouScreen(
|
|
|
|
ForYouScreen(
|
|
|
|
isSyncing = isSyncing,
|
|
|
|
isSyncing = isSyncing,
|
|
|
|
onboardingUiState = onboardingUiState,
|
|
|
|
onboardingUiState = onboardingUiState,
|
|
|
@ -125,6 +129,8 @@ internal fun ForYouScreen(
|
|
|
|
val isOnboardingLoading = onboardingUiState is OnboardingUiState.Loading
|
|
|
|
val isOnboardingLoading = onboardingUiState is OnboardingUiState.Loading
|
|
|
|
val isFeedLoading = feedState is NewsFeedUiState.Loading
|
|
|
|
val isFeedLoading = feedState is NewsFeedUiState.Loading
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.i("Caren", "Recreating ForYouScreen")
|
|
|
|
|
|
|
|
|
|
|
|
// Workaround to call Activity.reportFullyDrawn from Jetpack Compose.
|
|
|
|
// Workaround to call Activity.reportFullyDrawn from Jetpack Compose.
|
|
|
|
// This code should be called when the UI is ready for use
|
|
|
|
// This code should be called when the UI is ready for use
|
|
|
|
// and relates to Time To Full Display.
|
|
|
|
// and relates to Time To Full Display.
|
|
|
|