Updated on 2026-08-14
This commit is contained in:
parent
bdbe12ecf0
commit
d83a31a9b0
17 changed files with 159 additions and 92 deletions
|
|
@ -21,6 +21,8 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
|||
import androidx.compose.ui.unit.Constraints
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import java.text.NumberFormat
|
||||
import java.util.Locale
|
||||
|
||||
sealed class TextEllipsis {
|
||||
|
||||
|
|
@ -126,13 +128,27 @@ fun EllipsisText(
|
|||
)
|
||||
}
|
||||
is TextEllipsis.OffsetEnd -> {
|
||||
offsetEndEllipsisText(
|
||||
availableWidth = availableWidth,
|
||||
startCounter = startCounter,
|
||||
endCounter = endCounter,
|
||||
offsetEnd = ellipsis.offsetEnd,
|
||||
withSeparator = ellipsis.hasSeparator,
|
||||
)
|
||||
val locale = Locale.getDefault()
|
||||
val formatter = NumberFormat.getCurrencyInstance(locale)
|
||||
val formattedValue = formatter.format(1)
|
||||
|
||||
val isPrefixSymbol = formattedValue.startsWith(formatter.currency?.symbol.orEmpty())
|
||||
|
||||
if (isPrefixSymbol) {
|
||||
offsetEndEllipsisText(
|
||||
availableWidth = availableWidth,
|
||||
startCounter = startCounter,
|
||||
endCounter = endCounter,
|
||||
)
|
||||
} else {
|
||||
offsetEndEllipsisText(
|
||||
availableWidth = availableWidth,
|
||||
startCounter = startCounter,
|
||||
endCounter = endCounter,
|
||||
offsetEnd = ellipsis.offsetEnd,
|
||||
withSeparator = ellipsis.hasSeparator,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue