From 8d91b97962c26d7acae1f9b81b569144ef2d1b4d Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 24 Apr 2025 16:57:24 -0400 Subject: [PATCH] Migrates CircularProgresIndicator to the newer version --- .../vitorpamplona/amethyst/ui/note/ReactionsRow.kt | 13 +++++++------ .../loggedIn/dvms/DvmContentDiscoveryScreen.kt | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt index be93b31b4..fc283216c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt @@ -1096,13 +1096,14 @@ fun ZapReaction( if (zappingProgress > 0.00001 && zappingProgress < 0.99999) { Spacer(ModifierWidth3dp) + val animatedProgress by animateFloatAsState( + targetValue = zappingProgress, + animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec, + label = "ZapIconIndicator", + ) + CircularProgressIndicator( - progress = - animateFloatAsState( - targetValue = zappingProgress, - animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec, - label = "ZapIconIndicator", - ).value, + progress = { animatedProgress }, modifier = remember { Modifier.size(animationSize) }, strokeWidth = 2.dp, ) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmContentDiscoveryScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmContentDiscoveryScreen.kt index 9d8cfe558..e7e457b26 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmContentDiscoveryScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmContentDiscoveryScreen.kt @@ -531,13 +531,14 @@ fun ZapDVMButton( if (zappingProgress > 0.00001 && zappingProgress < 0.99999) { Spacer(ModifierWidth3dp) + val animatedProgress by animateFloatAsState( + targetValue = zappingProgress, + animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec, + label = "ZapIconIndicator", + ) + CircularProgressIndicator( - progress = - animateFloatAsState( - targetValue = zappingProgress, - animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec, - label = "ZapIconIndicator", - ).value, + progress = { animatedProgress }, modifier = remember { Modifier.size(animationSize) }, strokeWidth = 2.dp, color = grayTint,