mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-19 08:45:27 +02:00
Fixed (?) rendering issue with calculated value text
Hard to catch this bug, may still be broken
This commit is contained in:
parent
7c38a60788
commit
e0152b508e
@ -23,8 +23,10 @@ import androidx.compose.animation.AnimatedContent
|
|||||||
import androidx.compose.animation.AnimatedVisibility
|
import androidx.compose.animation.AnimatedVisibility
|
||||||
import androidx.compose.animation.SizeTransform
|
import androidx.compose.animation.SizeTransform
|
||||||
import androidx.compose.animation.expandHorizontally
|
import androidx.compose.animation.expandHorizontally
|
||||||
|
import androidx.compose.animation.expandVertically
|
||||||
import androidx.compose.animation.fadeIn
|
import androidx.compose.animation.fadeIn
|
||||||
import androidx.compose.animation.fadeOut
|
import androidx.compose.animation.fadeOut
|
||||||
|
import androidx.compose.animation.shrinkVertically
|
||||||
import androidx.compose.animation.with
|
import androidx.compose.animation.with
|
||||||
import androidx.compose.foundation.combinedClickable
|
import androidx.compose.foundation.combinedClickable
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
@ -124,6 +126,11 @@ fun MyTextField(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AnimatedVisibility(
|
||||||
|
visible = !secondaryText.isNullOrEmpty(),
|
||||||
|
enter = expandVertically(),
|
||||||
|
exit = shrinkVertically()
|
||||||
|
) {
|
||||||
LazyRow(
|
LazyRow(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.wrapContentHeight(),
|
.wrapContentHeight(),
|
||||||
@ -132,23 +139,19 @@ fun MyTextField(
|
|||||||
contentPadding = PaddingValues(horizontal = 8.dp)
|
contentPadding = PaddingValues(horizontal = 8.dp)
|
||||||
) {
|
) {
|
||||||
item {
|
item {
|
||||||
AnimatedVisibility(visible = !secondaryText.isNullOrEmpty()) {
|
AnimatedContent(
|
||||||
AnimatedContent(targetState = secondaryText,
|
targetState = secondaryText,
|
||||||
transitionSpec = {
|
transitionSpec = {
|
||||||
// Enter animation
|
// Enter animation
|
||||||
(expandHorizontally(
|
(expandHorizontally(clip = false, expandFrom = Alignment.Start) + fadeIn()
|
||||||
clip = false,
|
|
||||||
expandFrom = Alignment.Start
|
|
||||||
) + fadeIn()
|
|
||||||
// Exit animation
|
// Exit animation
|
||||||
with fadeOut())
|
with fadeOut())
|
||||||
.using(SizeTransform(clip = false))
|
.using(SizeTransform(clip = false))
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier
|
modifier = Modifier,
|
||||||
.fillMaxWidth(),
|
text = Formatter.format(it ?: ""),
|
||||||
text = Formatter.format(secondaryText ?: ""),
|
|
||||||
textAlign = TextAlign.End,
|
textAlign = TextAlign.End,
|
||||||
softWrap = false,
|
softWrap = false,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f),
|
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user