From 52ec53575af9073eb381eb73a28e2fa792db958d Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 11 Jul 2023 12:50:50 +0200 Subject: [PATCH] Timeline: improve "jump to bottom" button --- .../messages/impl/timeline/TimelineView.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineView.kt index bb33981a64..a8da9d5543 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineView.kt @@ -21,6 +21,7 @@ package io.element.android.features.messages.impl.timeline import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.animation.animateContentSize +import androidx.compose.animation.core.tween import androidx.compose.animation.scaleIn import androidx.compose.animation.scaleOut import androidx.compose.foundation.layout.Box @@ -278,8 +279,8 @@ internal fun BoxScope.TimelineScrollHelper( .align(Alignment.BottomEnd) .padding(end = 24.dp, bottom = 12.dp), visible = showScrollToBottomButton || LocalInspectionMode.current, - enter = scaleIn(), - exit = scaleOut(), + enter = scaleIn(animationSpec = tween(100)), + exit = scaleOut(animationSpec = tween(100)), ) { FloatingActionButton( onClick = { @@ -293,14 +294,7 @@ internal fun BoxScope.TimelineScrollHelper( }, elevation = FloatingActionButtonDefaults.elevation(4.dp, 4.dp, 4.dp, 4.dp), shape = CircleShape, - modifier = Modifier - .shadow( - elevation = 4.dp, - shape = CircleShape, - ambientColor = ElementTheme.materialColors.primary, - spotColor = ElementTheme.materialColors.primary, - ) - .size(36.dp), + modifier = Modifier.size(36.dp), containerColor = ElementTheme.colors.bgSubtleSecondary, contentColor = ElementTheme.colors.iconSecondary ) {