From f574a1dae53159da5b2cdafcd09e95225f6faa46 Mon Sep 17 00:00:00 2001 From: greenart7c3 Date: Fri, 6 Oct 2023 07:01:49 -0300 Subject: [PATCH] fix floatingActionButton not hiding --- .../amethyst/ui/screen/loggedIn/MainScreen.kt | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/MainScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/MainScreen.kt index df6cec710..160a0eb49 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/MainScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/MainScreen.kt @@ -3,6 +3,9 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn import android.content.res.Configuration import androidx.activity.compose.BackHandler import androidx.compose.animation.AnimatedContent +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.expandIn +import androidx.compose.animation.fadeIn import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideOutVertically import androidx.compose.animation.togetherWith @@ -42,6 +45,7 @@ import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalLifecycleOwner +import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver @@ -315,13 +319,18 @@ fun MainScreen( } }, floatingActionButton = { - FloatingButtons( - navState, - accountViewModel, - accountStateViewModel, - nav, - navBottomRow - ) + AnimatedVisibility( + visible = shouldShow.value, + enter = fadeIn() + expandIn { IntSize(width = 1, height = 1) } + ) { + FloatingButtons( + navState, + accountViewModel, + accountStateViewModel, + nav, + navBottomRow + ) + } } ) { Column(