Updated on 2026-08-14

This commit is contained in:
Tangem 2024-07-17 18:15:15 +04:00
parent bccd93464f
commit 4354a1f64d
2 changed files with 15 additions and 2 deletions

View file

@ -26,8 +26,8 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.tangem.core.ui.R import com.tangem.core.ui.R
import com.tangem.core.ui.res.TangemThemePreview
import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemThemePreview
/** /**
* [Show in Figma](https://www.figma.com/file/14ISV23YB1yVW1uNVwqrKv/Android?node-id=213%3A218&t=TmfD6UBHPg9uYfev-4) * [Show in Figma](https://www.figma.com/file/14ISV23YB1yVW1uNVwqrKv/Android?node-id=213%3A218&t=TmfD6UBHPg9uYfev-4)
@ -392,7 +392,11 @@ data class TangemTextFieldColors(
else -> unfocusedIndicatorColor else -> unfocusedIndicatorColor
} }
return if (enabled) { return if (enabled) {
animateColorAsState(targetValue, tween(durationMillis = 120)) animateColorAsState(
targetValue = targetValue,
animationSpec = tween(durationMillis = 120),
label = "IndicatorColor",
)
} else { } else {
rememberUpdatedState(targetValue) rememberUpdatedState(targetValue)
} }

View file

@ -1,5 +1,7 @@
package com.tangem.core.ui.res package com.tangem.core.ui.res
import androidx.compose.foundation.text.selection.LocalTextSelectionColors
import androidx.compose.foundation.text.selection.TextSelectionColors
import androidx.compose.material.Colors import androidx.compose.material.Colors
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
import androidx.compose.material.ProvideTextStyle import androidx.compose.material.ProvideTextStyle
@ -50,6 +52,7 @@ fun TangemTheme(
LocalHapticManager provides hapticManager, LocalHapticManager provides hapticManager,
LocalSnackbarHostState provides snackbarHostState, LocalSnackbarHostState provides snackbarHostState,
LocalWindowSize provides windowSize, LocalWindowSize provides windowSize,
LocalTextSelectionColors provides TangemTextSelectionColors,
) { ) {
CompositionLocalProvider( CompositionLocalProvider(
LocalTangemShimmer provides TangemShimmer, LocalTangemShimmer provides TangemShimmer,
@ -205,6 +208,12 @@ private fun darkThemeColors(): TangemColors {
) )
} }
@Stable
private val TangemTextSelectionColors = TextSelectionColors(
handleColor = TangemColorPalette.Azure,
backgroundColor = TangemColorPalette.Azure.copy(alpha = 0.4f),
)
private val LocalTangemColors = staticCompositionLocalOf<TangemColors> { private val LocalTangemColors = staticCompositionLocalOf<TangemColors> {
error("No TangemColors provided") error("No TangemColors provided")
} }