From 7a2430c3d5230c3d2c9a5e1b20e742c4ed3e1e61 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 19 Sep 2024 15:12:31 +0400 Subject: [PATCH 1/3] Updated on 2026-08-14 --- .../home/compose/views/StoriesButton.kt | 1 + .../com/tangem/core/ui/components/Buttons.kt | 9 ++++++- .../NotificationWithBackground.kt | 25 ++++++++++--------- .../notifications/OkxPromoNotification.kt | 15 +++++------ .../impl/ui/AddToPortfolioBottomSheet.kt | 1 + .../presentation/ui/SendNavigationButtons.kt | 3 ++- 6 files changed, 33 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/features/home/compose/views/StoriesButton.kt b/app/src/main/java/com/tangem/tap/features/home/compose/views/StoriesButton.kt index 45b8745cca..c2e879dc2d 100644 --- a/app/src/main/java/com/tangem/tap/features/home/compose/views/StoriesButton.kt +++ b/app/src/main/java/com/tangem/tap/features/home/compose/views/StoriesButton.kt @@ -26,6 +26,7 @@ internal fun StoriesButton( showProgress = showProgress, enabled = true, shape = TangemTheme.shapes.roundedCornersXMedium, + textStyle = TangemTheme.typography.subtitle1, iconPadding = when (icon) { is TangemButtonIconPosition.Start -> TangemTheme.dimens.spacing4 is TangemButtonIconPosition.End, diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/Buttons.kt b/core/ui/src/main/java/com/tangem/core/ui/components/Buttons.kt index 9667a00860..e43a390155 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/Buttons.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/Buttons.kt @@ -14,8 +14,8 @@ import androidx.compose.ui.text.TextStyle import androidx.compose.ui.tooling.preview.Preview import com.tangem.core.ui.R import com.tangem.core.ui.components.buttons.common.* -import com.tangem.core.ui.res.TangemThemePreview import com.tangem.core.ui.res.TangemTheme +import com.tangem.core.ui.res.TangemThemePreview // region TextButton /** @@ -102,6 +102,7 @@ fun PrimaryButton( enabled = enabled, showProgress = showProgress, size = size, + textStyle = TangemTheme.typography.subtitle1, ) } @@ -127,6 +128,7 @@ fun PrimaryButtonIconEnd( enabled = enabled, showProgress = showProgress, size = size, + textStyle = TangemTheme.typography.subtitle1, ) } @@ -153,6 +155,7 @@ fun PrimaryButtonIconEndTwoLines( showProgress = showProgress, additionalText = additionalText, size = TangemButtonSize.TwoLines, + textStyle = TangemTheme.typography.subtitle1, ) } @@ -176,6 +179,7 @@ fun PrimaryButtonIconStart( colors = TangemButtonsDefaults.primaryButtonColors, enabled = enabled, showProgress = showProgress, + textStyle = TangemTheme.typography.subtitle1, ) } // endregion PrimaryButton @@ -201,6 +205,7 @@ fun SecondaryButton( showProgress = showProgress, size = size, shape = shape, + textStyle = TangemTheme.typography.subtitle1, ) } @@ -224,6 +229,7 @@ fun SecondaryButtonIconEnd( colors = TangemButtonsDefaults.secondaryButtonColors, enabled = enabled, showProgress = showProgress, + textStyle = TangemTheme.typography.subtitle1, ) } @@ -247,6 +253,7 @@ fun SecondaryButtonIconStart( colors = TangemButtonsDefaults.secondaryButtonColors, enabled = enabled, showProgress = showProgress, + textStyle = TangemTheme.typography.subtitle1, ) } // endregion SecondaryButton diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/notifications/NotificationWithBackground.kt b/core/ui/src/main/java/com/tangem/core/ui/components/notifications/NotificationWithBackground.kt index a6031f054b..d76569543f 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/notifications/NotificationWithBackground.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/notifications/NotificationWithBackground.kt @@ -7,9 +7,9 @@ import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.defaultMinSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.size -import androidx.compose.material3.ripple 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.Modifier @@ -132,17 +132,6 @@ fun NotificationWithBackground(config: NotificationConfig, modifier: Modifier = ) val isDarkMode = LocalIsInDarkTheme.current TangemButton( - text = button?.text?.resolveReference().orEmpty(), - icon = TangemButtonIconPosition.Start(button?.iconResId ?: R.drawable.ic_exchange_vertical_24), - onClick = button?.onClick ?: {}, - colors = TangemButtonColors( - backgroundColor = if (isDarkMode) Light4 else TangemTheme.colors.button.secondary, - contentColor = Dark6, - disabledBackgroundColor = TangemTheme.colors.button.disabled, - disabledContentColor = TangemTheme.colors.text.disabled, - ), - enabled = true, - showProgress = false, modifier = Modifier.constrainAs(buttonRef) { start.linkTo(parent.start, spacing12) end.linkTo(parent.end, spacing12) @@ -154,6 +143,18 @@ fun NotificationWithBackground(config: NotificationConfig, modifier: Modifier = Visibility.Visible } }, + text = button?.text?.resolveReference().orEmpty(), + icon = TangemButtonIconPosition.Start(button?.iconResId ?: R.drawable.ic_exchange_vertical_24), + onClick = button?.onClick ?: {}, + colors = TangemButtonColors( + backgroundColor = if (isDarkMode) Light4 else TangemTheme.colors.button.secondary, + contentColor = Dark6, + disabledBackgroundColor = TangemTheme.colors.button.disabled, + disabledContentColor = TangemTheme.colors.text.disabled, + ), + textStyle = TangemTheme.typography.subtitle1, + enabled = true, + showProgress = false, ) } } diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/notifications/OkxPromoNotification.kt b/core/ui/src/main/java/com/tangem/core/ui/components/notifications/OkxPromoNotification.kt index 2888045227..94f39ed5dd 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/notifications/OkxPromoNotification.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/notifications/OkxPromoNotification.kt @@ -110,6 +110,13 @@ private fun Button(config: NotificationConfig) { button?.let { val isDarkMode = LocalIsInDarkTheme.current TangemButton( + modifier = Modifier + .fillMaxWidth() + .padding( + start = TangemTheme.dimens.spacing12, + end = TangemTheme.dimens.spacing12, + bottom = TangemTheme.dimens.spacing12, + ), text = button.text.resolveReference(), icon = TangemButtonIconPosition.Start(button.iconResId ?: R.drawable.ic_exchange_vertical_24), onClick = button.onClick, @@ -119,15 +126,9 @@ private fun Button(config: NotificationConfig) { disabledBackgroundColor = TangemTheme.colors.button.disabled, disabledContentColor = TangemTheme.colors.text.disabled, ), + textStyle = TangemTheme.typography.subtitle1, enabled = true, showProgress = false, - modifier = Modifier - .fillMaxWidth() - .padding( - start = TangemTheme.dimens.spacing12, - end = TangemTheme.dimens.spacing12, - bottom = TangemTheme.dimens.spacing12, - ), ) } } diff --git a/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/AddToPortfolioBottomSheet.kt b/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/AddToPortfolioBottomSheet.kt index 4f99ce0afd..73f6dca547 100644 --- a/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/AddToPortfolioBottomSheet.kt +++ b/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/AddToPortfolioBottomSheet.kt @@ -163,6 +163,7 @@ private fun ContinueButton( showProgress = false, size = TangemButtonSize.Default, colors = TangemButtonsDefaults.primaryButtonColors, + textStyle = TangemTheme.typography.subtitle1, onClick = onClick, animateContentChange = true, ) diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/ui/SendNavigationButtons.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/ui/SendNavigationButtons.kt index 8cd6867e1d..85b4d38175 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/ui/SendNavigationButtons.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/ui/SendNavigationButtons.kt @@ -127,6 +127,7 @@ private fun SendNavigationButton( } } TangemButton( + modifier = Modifier.fillMaxWidth(), text = stringResource(buttonTextId), icon = buttonIcon, enabled = isButtonEnabled, @@ -135,8 +136,8 @@ private fun SendNavigationButton( buttonClick() }, showProgress = false, - modifier = Modifier.fillMaxWidth(), colors = TangemButtonsDefaults.primaryButtonColors, + textStyle = TangemTheme.typography.subtitle1, ) } } From 8a7dd57c13bb8ee5d5a550183e68ca155287468d Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 19 Sep 2024 15:24:20 +0500 Subject: [PATCH 2/3] Updated on 2026-08-14 --- .../impl/presentation/state/utils/FeeCalculation.kt | 7 ++++++- gradle/dependencies.toml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/utils/FeeCalculation.kt b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/utils/FeeCalculation.kt index 0f1857c60b..f3a7078d7d 100644 --- a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/utils/FeeCalculation.kt +++ b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/utils/FeeCalculation.kt @@ -31,7 +31,12 @@ internal fun checkAndCalculateSubtractedAmount( reduceAmountBy = reduceAmountBy, ) return if (isFeeCoverage) { - balance.minus(reduceAmountBy).minus(feeValueRounded) + val reducedAmount = balance.minus(reduceAmountBy).minus(feeValueRounded) + if (isTron(cryptoCurrencyStatus.currency.network.id.value)) { + reducedAmount.setScale(0, RoundingMode.DOWN) + } else { + reducedAmount + } } else { amountValue } diff --git a/gradle/dependencies.toml b/gradle/dependencies.toml index 7e7f4a8b81..49b3c92007 100644 --- a/gradle/dependencies.toml +++ b/gradle/dependencies.toml @@ -89,7 +89,7 @@ markdownComposeView = "0.5.4" # endregion Other libraries # region Tangem -tangemBlockchainSdk = "release-app_5.15-780" +tangemBlockchainSdk = "release-app_5.15-781" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds tangemCardSdk = "release-app_5.15-382" #tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^ From f181b8707ebe50fe7a4cb6f65d815327a72eaab6 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 19 Sep 2024 17:06:45 +0300 Subject: [PATCH 3/3] Updated on 2026-08-14 --- .../features/send/impl/presentation/ui/SendNavigationButtons.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/ui/SendNavigationButtons.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/ui/SendNavigationButtons.kt index 85b4d38175..864a75afa0 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/ui/SendNavigationButtons.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/ui/SendNavigationButtons.kt @@ -275,7 +275,7 @@ private fun isButtonEnabled(currentState: SendUiCurrentScreen, uiState: SendUiSt private fun getTokenFeeSendingText(feeState: SendStates.FeeState, fee: Fee.Tron, sendingValue: String): TextReference { val suffix = when { - fee.feeEnergy == 0L -> { + fee.remainingEnergy == 0L -> { resourceReference( R.string.send_summary_transaction_description_suffix_including, wrappedList(feeState.getFiatValue()),