diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/AppBar.kt b/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/AppBar.kt index 00d1d313ca..8fbe666e83 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/AppBar.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/AppBar.kt @@ -2,7 +2,6 @@ package io.horizontalsystems.bankwallet.ui.compose.components import androidx.annotation.DrawableRes import androidx.compose.foundation.background -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding @@ -18,9 +17,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.scale import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource -import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.text.style.TextOverflow -import androidx.compose.ui.text.toUpperCase import androidx.compose.ui.unit.dp import io.horizontalsystems.bankwallet.ui.compose.ComposeAppTheme import io.horizontalsystems.bankwallet.ui.compose.TranslatableString @@ -187,16 +184,14 @@ private fun MenuItemSimple(menuItem: MenuItem) { showAlertDot = menuItem.showAlertDot, ) } else { - Text( - modifier = Modifier - .padding(horizontal = 16.dp) - .clickable( - enabled = menuItem.enabled, - onClick = menuItem.onClick - ), - text = menuItem.title.getString().toUpperCase(Locale.current), - style = ComposeAppTheme.typography.headline2, - color = color - ) + ButtonPrimaryWrapper( + enabled = menuItem.enabled, + onClick = menuItem.onClick + ){ + Text( + text = menuItem.title.getString().uppercase(), + color = color + ) + } } } diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/ButtonPrimary.kt b/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/ButtonPrimary.kt index a92e09aec8..dacbe26757 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/ButtonPrimary.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/ButtonPrimary.kt @@ -5,6 +5,7 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.collectIsPressedAsState import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.RowScope @@ -25,6 +26,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Shape import androidx.compose.ui.res.painterResource @@ -279,6 +281,36 @@ fun ButtonPrimaryYellowWithSpinner( ) } +@Composable +fun ButtonPrimaryWrapper( + modifier: Modifier = Modifier, + enabled: Boolean = true, + onClick: () -> Unit, + content: @Composable () -> Unit +) { + ProvideTextStyle( + value = ComposeAppTheme.typography.headline2 + ) { + Box( + modifier = modifier + .clip(RoundedCornerShape(25.dp)) + .defaultMinSize( + minWidth = ButtonPrimaryDefaults.MinWidth, + minHeight = ButtonPrimaryDefaults.MinHeight + ) + .clickable( + enabled = enabled, + onClick = onClick, + ) + .padding(ButtonPrimaryDefaults.ContentPadding), + contentAlignment = Alignment.Center, + ) { + content() + } + } +} + + @OptIn(ExperimentalMaterialApi::class) @Composable fun ButtonPrimary( diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/ButtonSecondary.kt b/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/ButtonSecondary.kt index 2bc8dd82ab..b2705e7cb9 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/ButtonSecondary.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/ui/compose/components/ButtonSecondary.kt @@ -50,9 +50,9 @@ fun ButtonSecondaryDefault( onClick = onClick, content = { if (enabled) { - subhead1_leah(text = title, maxLines = 1) + captionSB_leah(text = title, maxLines = 1) } else { - subhead1_grey50(text = title, maxLines = 1) + captionSB_grey50(text = title, maxLines = 1) } }, enabled = enabled @@ -79,6 +79,7 @@ fun ButtonSecondaryYellow( Text( title, maxLines = 1, + style = ComposeAppTheme.typography.captionSB, overflow = TextOverflow.Ellipsis, ) }, @@ -99,19 +100,19 @@ fun ButtonSecondaryWithIcon( onClick = onClick, contentPadding = PaddingValues( start = 16.dp, - end = 12.dp, + end = 8.dp, ), content = { Row( verticalAlignment = Alignment.CenterVertically ) { - subhead1_leah( + captionSB_leah( text = title, maxLines = 1, overflow = TextOverflow.Ellipsis ) Icon( - modifier = Modifier.padding(start = 4.dp), + modifier = Modifier.padding(start = 2.dp), painter = iconRight, contentDescription = null, tint = ComposeAppTheme.colors.grey @@ -146,6 +147,7 @@ fun ButtonSecondaryTransparent( Text( title, maxLines = 1, + style = ComposeAppTheme.typography.captionSB, overflow = TextOverflow.Ellipsis, ) Icon( @@ -184,7 +186,12 @@ fun ButtonSecondaryToggle( modifier = Modifier.height(IntrinsicSize.Max), verticalAlignment = Alignment.CenterVertically ) { - Text(select.selected.title.getString(), maxLines = 1, overflow = TextOverflow.Ellipsis) + Text( + text = select.selected.title.getString(), + maxLines = 1, + style = ComposeAppTheme.typography.captionSB, + overflow = TextOverflow.Ellipsis + ) Column( modifier = Modifier .height(16.dp)