fix: 编辑器提示文本动画错误

This commit is contained in:
Super12138 2025-07-04 11:01:28 +08:00
parent 34b316120a
commit e8ac66c5ae

View file

@ -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))
}
},