diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/TangemSwitch.kt b/core/ui/src/main/java/com/tangem/core/ui/components/TangemSwitch.kt index 8e0081a633..7b3c924e95 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/TangemSwitch.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/TangemSwitch.kt @@ -15,6 +15,7 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.semantics.Role import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import com.tangem.core.ui.res.TangemTheme @@ -23,6 +24,8 @@ import com.tangem.core.ui.res.TangemTheme @Composable fun TangemSwitch( onCheckedChange: (Boolean) -> Unit, + modifier: Modifier = Modifier, + interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, checkedColor: Color = TangemTheme.colors.control.checked, uncheckedColor: Color = TangemTheme.colors.icon.informative, size: Dp = 48.dp, @@ -39,23 +42,20 @@ fun TangemSwitch( (if (isChecked) checkedColor else uncheckedColor) .copy(alpha = if (enabled) 1f else .4f) } - val interactionSource = remember { MutableInteractionSource() } Box( - modifier = Modifier + modifier = modifier .clickable( - interactionSource = interactionSource, - indication = null, - enabled = enabled, - ) { - onCheckedChange(!checked) - } - .indication( interactionSource = interactionSource, indication = rememberRipple( bounded = false, color = Color.Transparent, ), + enabled = enabled, + role = Role.Switch, + onClick = { + onCheckedChange(!checked) + }, ), ) { BoxWithConstraints( diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/ui/ManageTokensScreen.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/ui/ManageTokensScreen.kt index 4f9b2f3874..63a14af8d4 100644 --- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/ui/ManageTokensScreen.kt +++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/ui/ManageTokensScreen.kt @@ -6,12 +6,12 @@ import androidx.compose.animation.* import androidx.compose.animation.core.animateFloatAsState import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material3.FabPosition import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -190,30 +190,26 @@ private fun BasicCurrencyItem(item: CurrencyItemUM.Basic, modifier: Modifier = M Column(modifier = modifier) { ChainRow( + modifier = Modifier.clickable(onClick = item.onExpandClick), model = item.model, action = { - IconButton( - modifier = Modifier.size(TangemTheme.dimens.size32), - onClick = item.onExpandClick, - ) { - val rotation by animateFloatAsState( - targetValue = if (isExpanded) { - CHEVRON_ROTATION_EXPANDED - } else { - CHEVRON_ROTATION_COLLAPSED - }, - label = "chevron_rotation", - ) + val rotation by animateFloatAsState( + targetValue = if (isExpanded) { + CHEVRON_ROTATION_EXPANDED + } else { + CHEVRON_ROTATION_COLLAPSED + }, + label = "chevron_rotation", + ) - Icon( - modifier = Modifier - .rotate(rotation) - .size(TangemTheme.dimens.size24), - painter = painterResource(id = R.drawable.ic_chevron_24), - tint = TangemTheme.colors.icon.informative, - contentDescription = null, - ) - } + Icon( + modifier = Modifier + .rotate(rotation) + .size(TangemTheme.dimens.size24), + painter = painterResource(id = R.drawable.ic_chevron_24), + tint = TangemTheme.colors.icon.informative, + contentDescription = null, + ) }, )