Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-19 18:31:19 +03:00
commit bf006cab28
9 changed files with 43 additions and 27 deletions

View file

@ -239,9 +239,8 @@ class WalletConnectSdkHelper {
private suspend fun signTransaction(data: WcTransactionData, cardId: String?): String? {
val dataToSign = EthereumUtils.buildTransactionToSign(
transactionData = data.transaction,
nonce = null,
blockchain = data.walletManager.wallet.blockchain,
) ?: return null
)
val command = SignHashCommand(
hash = dataToSign.hash,

View file

@ -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,

View file

@ -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

View file

@ -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,
)
}
}

View file

@ -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,
),
)
}
}

View file

@ -163,6 +163,7 @@ private fun ContinueButton(
showProgress = false,
size = TangemButtonSize.Default,
colors = TangemButtonsDefaults.primaryButtonColors,
textStyle = TangemTheme.typography.subtitle1,
onClick = onClick,
animateContentChange = true,
)

View file

@ -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,
)
}
}
@ -274,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()),

View file

@ -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
}

View file

@ -89,9 +89,9 @@ markdownComposeView = "0.5.4"
# endregion Other libraries
# region Tangem
tangemBlockchainSdk = "release-app_5.15-780"
tangemBlockchainSdk = "develop-782"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "release-app_5.15-382"
tangemCardSdk = "develop-381"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^
tangemVico = "2.0.0-alpha.25-tangem16"
#tangemVico = "0.0.1" # Keep it! - used for local builds ^