From 9dc969fe63fdca9a7a0d80d5447760b9a9230e2a Mon Sep 17 00:00:00 2001 From: Yura Laguta <1853043+YuraLaguta@users.noreply.github.com> Date: Tue, 25 Oct 2022 17:22:03 +1100 Subject: [PATCH] Fixes #341 Defines enter & exit animations for OverlayLoadingWheel on ForYouScreen --- .../apps/nowinandroid/feature/foryou/ForYouScreen.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt b/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt index 4651e1204..3afd6e0f3 100644 --- a/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt +++ b/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt @@ -18,6 +18,10 @@ package com.google.samples.apps.nowinandroid.feature.foryou import android.app.Activity 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.Box import androidx.compose.foundation.layout.BoxWithConstraints @@ -193,7 +197,13 @@ internal fun ForYouScreen( AnimatedVisibility( visible = isSyncing || 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) Box(