From e8ac66c5ae46c38cf9d8f9dadf00d4b6c1efac2b Mon Sep 17 00:00:00 2001 From: Super12138 <70494801+Super12138@users.noreply.github.com> Date: Fri, 4 Jul 2025 11:01:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BC=96=E8=BE=91=E5=99=A8=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E6=9C=AC=E5=8A=A8=E7=94=BB=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/components/TodoEditorTextFields.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/components/TodoEditorTextFields.kt b/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/components/TodoEditorTextFields.kt index 68ea089..fa4e520 100644 --- a/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/components/TodoEditorTextFields.kt +++ b/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/components/TodoEditorTextFields.kt @@ -1,6 +1,10 @@ package cn.super12138.todo.ui.pages.editor.components import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.expandVertically +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.compose.animation.shrinkVertically import androidx.compose.material3.Text import androidx.compose.material3.TextField import androidx.compose.runtime.Composable @@ -21,7 +25,11 @@ fun TodoContentTextField( label = { Text(stringResource(R.string.placeholder_add_todo)) }, isError = isError, supportingText = { - AnimatedVisibility(isError) { + AnimatedVisibility( + visible = isError, + enter = fadeIn() + expandVertically(), + exit = fadeOut() + shrinkVertically() + ) { Text(stringResource(R.string.error_no_content_entered)) } }, @@ -42,7 +50,11 @@ fun TodoCategoryTextField( label = { Text(stringResource(R.string.label_enter_category_name)) }, isError = isError, supportingText = { - AnimatedVisibility(isError) { + AnimatedVisibility( + visible = isError, + enter = fadeIn() + expandVertically(), + exit = fadeOut() + shrinkVertically() + ) { Text(stringResource(R.string.error_no_content_entered)) } },