From 6c7d4acbc2bacbe5bfd6dc1a29cfc94b0fcd3033 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 7 Aug 2024 17:31:12 +0500 Subject: [PATCH 1/2] Updated on 2026-08-14 --- .../viewmodels/intents/WalletPushPermissionClickIntents.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletPushPermissionClickIntents.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletPushPermissionClickIntents.kt index 13a301f372..6043a409aa 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletPushPermissionClickIntents.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletPushPermissionClickIntents.kt @@ -35,10 +35,11 @@ internal class WalletPushPermissionClickIntentsImplementor @Inject constructor( } override fun onNeverAskPushPermission(isUserDismissed: Boolean) { - if (!isUserDismissedDialog) return - isUserDismissedDialog = isUserDismissed + if (isUserDismissedDialog != isUserDismissed) return viewModelScope.launch { - PushNotificationAnalyticEvents.ButtonCancel(AnalyticsParam.ScreensSources.Main) + analyticsEventHandler.send( + PushNotificationAnalyticEvents.ButtonCancel(AnalyticsParam.ScreensSources.Main), + ) neverRequestPermissionUseCase(PUSH_PERMISSION) } } From 62e971d6820d0c98de365c498375a4301af75b52 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 7 Aug 2024 18:55:21 +0300 Subject: [PATCH 2/2] Updated on 2026-08-14 --- .../ui/components/TokenInfoBlock.kt | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt index a6d81965bb..9a7a77dd53 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt @@ -3,8 +3,8 @@ package com.tangem.feature.tokendetails.presentation.tokendetails.ui.components import android.content.res.Configuration import androidx.compose.foundation.background import androidx.compose.foundation.layout.* -import androidx.compose.material.Text import androidx.compose.material3.Icon +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Alignment @@ -73,17 +73,22 @@ private fun NetworkInfoText(currency: TokenInfoBlockState.Currency) { horizontalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing4), ) { val state = extractNetwork(tokenCurrency = currency) - Text( - text = state.normalText, - style = TangemTheme.typography.caption2, - color = TangemTheme.colors.text.tertiary, - ) + + if (state.normalText.isNotBlank()) { + Text( + text = state.normalText, + style = TangemTheme.typography.caption2, + color = TangemTheme.colors.text.tertiary, + ) + } + Icon( modifier = Modifier.size(TangemTheme.dimens.size16), painter = painterResource(id = currency.networkIcon), tint = Color.Unspecified, contentDescription = null, ) + Text( text = state.boldText, style = TangemTheme.typography.caption1, @@ -94,7 +99,7 @@ private fun NetworkInfoText(currency: TokenInfoBlockState.Currency) { } } -private const val SEPARATOR = " %image% " +private const val SEPARATOR = "%image%" @Composable private fun extractNetwork(tokenCurrency: TokenInfoBlockState.Currency.Token): ExtractedTokenNetworkText { @@ -105,20 +110,20 @@ private fun extractNetwork(tokenCurrency: TokenInfoBlockState.Currency.Token): E tokenCurrency.standardName, tokenCurrency.networkName, ), - ).split(SEPARATOR) + ) } else { stringResource( id = R.string.token_details_token_type_subtitle_no_standard, formatArgs = arrayOf( tokenCurrency.networkName, ), - ).split(SEPARATOR) + ) } return remember(splitString) { ExtractedTokenNetworkText( - normalText = splitString.firstOrNull().orEmpty(), - boldText = splitString.getOrNull(1).orEmpty(), + normalText = splitString.substringBefore(delimiter = SEPARATOR, missingDelimiterValue = "").trim(), + boldText = splitString.substringAfterLast(delimiter = SEPARATOR).trim(), ) } } @@ -130,6 +135,7 @@ private data class ExtractedTokenNetworkText( @Preview @Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) +@Preview(locale = "ja") @Composable private fun Preview_TokenInfoBlock( @PreviewParameter(TokenInfoStateProvider::class)