Fixes #341 Defines enter & exit animations for OverlayLoadingWheel on ForYouScreen

pull/358/head
Yura Laguta 2 years ago
parent c62673d035
commit 9dc969fe63

@ -18,6 +18,10 @@ package com.google.samples.apps.nowinandroid.feature.foryou
import android.app.Activity import android.app.Activity
import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.BoxWithConstraints
@ -193,7 +197,13 @@ internal fun ForYouScreen(
AnimatedVisibility( AnimatedVisibility(
visible = isSyncing || visible = isSyncing ||
feedState is NewsFeedUiState.Loading || feedState is NewsFeedUiState.Loading ||
onboardingUiState is OnboardingUiState.Loading onboardingUiState is OnboardingUiState.Loading,
enter = slideInVertically(
initialOffsetY = { fullHeight -> -fullHeight },
) + fadeIn(),
exit = slideOutVertically(
targetOffsetY = { fullHeight -> -fullHeight },
) + fadeOut(),
) { ) {
val loadingContentDescription = stringResource(id = R.string.for_you_loading) val loadingContentDescription = stringResource(id = R.string.for_you_loading)
Box( Box(

Loading…
Cancel
Save