diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/label/Label.kt b/core/ui/src/main/java/com/tangem/core/ui/components/label/Label.kt index 951e6a5042..2cc6209978 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/label/Label.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/label/Label.kt @@ -16,6 +16,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.vector.ImageVector import androidx.compose.ui.res.vectorResource import androidx.compose.ui.tooling.preview.Preview @@ -68,9 +69,18 @@ fun Label(state: LabelUM, modifier: Modifier = Modifier) { horizontalArrangement = Arrangement.spacedBy(4.dp), modifier = modifier .padding(horizontal = 4.dp) - .background( - color = backgroundColor, - shape = TangemTheme.shapes.roundedCorners8, + .clip(TangemTheme.shapes.roundedCorners8) + .background(color = backgroundColor) + .then( + if (state.onClick != null) { + Modifier.clickable( + interactionSource = remember { MutableInteractionSource() }, + indication = ripple(), + onClick = state.onClick, + ) + } else { + Modifier + }, ) .padding(horizontal = 8.dp, vertical = 4.dp), ) { @@ -86,11 +96,13 @@ fun Label(state: LabelUM, modifier: Modifier = Modifier) { imageVector = ImageVector.vectorResource(wrappedIcon), tint = iconColor, contentDescription = null, - modifier = Modifier.size(16.dp).clickable( - interactionSource = remember { MutableInteractionSource() }, - indication = ripple(bounded = false), - onClick = { state.onIconClick?.invoke() }, - ), + modifier = Modifier + .size(16.dp) + .clickable( + interactionSource = remember { MutableInteractionSource() }, + indication = ripple(bounded = false), + onClick = { state.onIconClick?.invoke() }, + ), ) } } diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/label/entity/LabelUM.kt b/core/ui/src/main/java/com/tangem/core/ui/components/label/entity/LabelUM.kt index 1be654c994..9982a897b0 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/label/entity/LabelUM.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/label/entity/LabelUM.kt @@ -8,6 +8,7 @@ data class LabelUM( val style: LabelStyle, @DrawableRes val icon: Int? = null, val onIconClick: (() -> Unit)? = null, + val onClick: (() -> Unit)? = null, ) enum class LabelStyle { diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/apy/ui/YieldSupplyApyContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/apy/ui/YieldSupplyApyContent.kt index 8d419ff256..ad2186300f 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/apy/ui/YieldSupplyApyContent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/apy/ui/YieldSupplyApyContent.kt @@ -12,10 +12,12 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.text.InlineTextContent import androidx.compose.foundation.text.appendInlineContent import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.Placeholder import androidx.compose.ui.text.PlaceholderVerticalAlign @@ -114,7 +116,10 @@ internal fun YieldSupplyApyContent( ApyChart( isChartLoading = isLoading, chartComponent = chartComponent, - modifier = Modifier.padding(horizontal = 12.dp), + modifier = Modifier + .clip(RoundedCornerShape(14.dp)) + .background(TangemTheme.colors.background.action) + .padding(12.dp), ) SpacerH16() diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt index 5f3097807a..dc7127e226 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt @@ -4,13 +4,16 @@ import android.content.res.Configuration import androidx.annotation.DrawableRes import androidx.compose.foundation.background import androidx.compose.foundation.clickable +import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.* -import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Icon import androidx.compose.material3.Text +import androidx.compose.material3.ripple import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector @@ -106,7 +109,7 @@ private fun ColumnScope.Content(yieldSupplyPromoUM: YieldSupplyPromoUM, clickInt text = yieldSupplyPromoUM.subtitle, style = LabelStyle.REGULAR, icon = R.drawable.ic_information_24, - onIconClick = clickIntents::onApyInfoClick, + onClick = clickIntents::onApyInfoClick, ), ) SpacerH32() @@ -131,7 +134,11 @@ private fun YieldStatusAppBar(onBackClick: () -> Unit, onHowItWorksClick: () -> imageVector = ImageVector.vectorResource(R.drawable.ic_back_24), contentDescription = null, tint = TangemTheme.colors.icon.primary1, - modifier = Modifier.clickable(onClick = onBackClick), + modifier = Modifier.clickable( + onClick = onBackClick, + interactionSource = remember { MutableInteractionSource() }, + indication = ripple(bounded = false), + ), ) SpacerWMax() Text( diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt index 0654981fee..689c77d719 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt @@ -26,7 +26,10 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.unit.dp import com.tangem.common.ui.notifications.NotificationUM -import com.tangem.core.ui.components.* +import com.tangem.core.ui.components.SpacerH4 +import com.tangem.core.ui.components.SpacerH8 +import com.tangem.core.ui.components.SpacerWMax +import com.tangem.core.ui.components.TextShimmer import com.tangem.core.ui.components.notifications.Notification import com.tangem.core.ui.components.notifications.NotificationConfig import com.tangem.core.ui.decompose.ComposableContentComponent @@ -61,7 +64,7 @@ internal fun YieldSupplyActiveContent( .padding(12.dp), ) { CurrentApy(state.apy) - chartComponent.Content(Modifier.padding(bottom = 12.dp)) + chartComponent.Content(Modifier) } AnimatedVisibility(state.notifications.isNotEmpty()) { @@ -104,7 +107,7 @@ internal fun YieldSupplyActiveContent( @Composable private fun CurrentApy(apy: TextReference?, modifier: Modifier = Modifier) { - Column(modifier = modifier.padding(vertical = 12.dp)) { + Column(modifier = modifier) { Text( modifier = Modifier, text = stringResourceSafe(R.string.yield_module_earn_sheet_current_apy_title), @@ -156,7 +159,11 @@ private fun YieldSupplyActiveMyFunds( .clip(RoundedCornerShape(16.dp)) .background(TangemTheme.colors.background.action) .fillMaxWidth() - .padding(12.dp), + .padding( + top = 12.dp, + start = 12.dp, + end = 12.dp, + ), ) { Text( text = stringResourceSafe(R.string.yield_module_earn_sheet_my_funds_title), diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/feepolicy/ui/YieldSupplyFeePolicyContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/feepolicy/ui/YieldSupplyFeePolicyContent.kt index 23b09ad7f7..f00297a2f9 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/feepolicy/ui/YieldSupplyFeePolicyContent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/feepolicy/ui/YieldSupplyFeePolicyContent.kt @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -100,6 +101,10 @@ internal fun YieldSupplyFeePolicyContent( YieldSupplyFeeUM.Error -> stringReference(StringsSigns.DASH_SIGN) YieldSupplyFeeUM.Loading -> null } + HorizontalDivider( + thickness = 0.5.dp, + color = TangemTheme.colors.stroke.primary, + ) YieldSupplyFeeRow( title = resourceReference(R.string.yield_module_fee_policy_sheet_max_fee_title), value = maxFee,