From 090aef6a4779f7a932d9dd38fa9a0dfaae7c776a Mon Sep 17 00:00:00 2001 From: machiav3lli Date: Sun, 29 May 2022 03:19:55 +0200 Subject: [PATCH] Update: Comment out animation for now (till implementing better logic to handle changing state) --- .../ui/compose/components/ActionButton.kt | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/main/kotlin/com/looker/droidify/ui/compose/components/ActionButton.kt b/src/main/kotlin/com/looker/droidify/ui/compose/components/ActionButton.kt index 5ad8d53d..45507978 100644 --- a/src/main/kotlin/com/looker/droidify/ui/compose/components/ActionButton.kt +++ b/src/main/kotlin/com/looker/droidify/ui/compose/components/ActionButton.kt @@ -2,12 +2,6 @@ package com.looker.droidify.ui.compose.components import androidx.compose.animation.AnimatedContent import androidx.compose.animation.ExperimentalAnimationApi -import androidx.compose.animation.SizeTransform -import androidx.compose.animation.fadeIn -import androidx.compose.animation.fadeOut -import androidx.compose.animation.slideInVertically -import androidx.compose.animation.slideOutVertically -import androidx.compose.animation.with import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -38,19 +32,20 @@ fun MainActionButton( ) { AnimatedContent( targetState = packageState, - transitionSpec = { - //when (targetState) { - /*is Cancelable -> { - slideInVertically { height -> height } + fadeIn() with - slideOutVertically { height -> -height } + fadeOut() - }*/ - //is ButtonWork -> { - (slideInVertically { height -> -height } + fadeIn() with - slideOutVertically { height -> height } + fadeOut()) - //} - //} + // TODO Fix redrawing changing state + /*transitionSpec = { + when (targetState) { + is Cancelable -> { + slideInVertically { height -> height } + fadeIn() with + slideOutVertically { height -> -height } + fadeOut() + } + is ButtonWork -> { + (slideInVertically { height -> -height } + fadeIn() with + slideOutVertically { height -> height } + fadeOut()) + } + } .using(SizeTransform(clip = false)) - } + }*/ ) { Row( Modifier