diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml index 65a4990969..d8c34ccdc5 100644 --- a/core/res/src/main/res/values-de/strings.xml +++ b/core/res/src/main/res/values-de/strings.xml @@ -180,6 +180,7 @@ Nutzungsbedingungen Heute Transaktion fehlgeschlagen + Transaktionsstatus Transaktionen Überweisung Ich verstehe @@ -187,6 +188,7 @@ Nicht erreichbar staking beenden woche + mit Ja Vertragsadresse kopiert! Verfügbare Netzwerke @@ -292,6 +294,9 @@ Für dieses Paar nicht verfügbar Erlaubnis erforderlich Empfohlen + Gekauft %s + Kauf %s + Kauf %s... Keine Token gefunden. Bitte versuche eine andere Anfrage ID: %s Transaktions-ID kopiert @@ -568,13 +573,14 @@ Keine verfügbaren Anbieter für diese Währung Bezahlen mit Du kannst Deine Transaktion beim Drittanbieter %s abschließen. - Umleitung auf %s … + Umleitung auf %s… Unsere Dienstleistungen sind in diesem Land nicht verfügbar Änder oder bestätige bitte Dein Wohnsitz wurde identifiziert als Residenz Bitte wähle das richtige Land aus, um korrekte Zahlungsoptionen und Dienstleistungen zu gewährleisten. Einstellungen + Du kannst den Transaktionsstatus auf der Token-Seite überprüfen. Über Gruppe erstellen Nach Guthaben @@ -853,14 +859,14 @@ Angezeigte Salden Rückgängig machen Dieser Vorgang ist derzeit nicht verfügbar. Bitte versuche es später noch einmal. - Der Kauf von %s ist im Moment nicht verfügbar. Bitte prüfe später ob es Updates gibt. + Der Kauf von %s wird von aktuellen Anbietern nicht unterstützt, aber wir arbeiten daran, weitere Optionen hinzuzufügen. Du hast kein Guthaben um dies zu Verkaufen. Lade dein Konto auf, um Geld von dort zu verkaufen. Du hast kein Guthaben zum Versenden. Lade dein Konto auf, um Geld von dort aus senden zu können. - Swappen %s ist im Moment nicht verfügbar. Bitte prüfe später ob es Updates gibt. + Das Tauschen von %s wird von aktuellen Anbietern nicht unterstützt, aber wir arbeiten daran, weitere Optionen hinzuzufügen. Das Geld für den Verkauf steht zur Verfügung, sobald die ausstehende(n) Transaktion(en) im Netzwerk %s abgeschlossen ist/sind. Die Geldsendung wird verfügbar, sobald die ausstehende(n) Transaktion(en) im Netzwerk %s abgeschlossen ist/sind. - Der Verkauf von %s ist im Moment nicht verfügbar. Bitte prüfe später ob es Updates gibt. - Staking %s ist aktuell nicht verfügbar. Prüfe bitte ob es ein neues Update gibt. + Der Verkauf von %s wird von aktuellen Anbietern nicht unterstützt, aber wir arbeiten daran, weitere Optionen hinzuzufügen. + Staking %s wird von aktuellen Anbietern nicht unterstützt, aber wir arbeiten daran, weitere Optionen hinzuzufügen. Generiere XPUB Ausblenden Du bist dabei, dieses Token vom Hauptbildschirm auszublenden. Du kannst es jederzeit über die Seite „Token verwalten“ wieder hinzufügen. @@ -953,6 +959,9 @@ %s Netzwerk Die Adresse wurde erfolgreich kopiert Keine Internetverbindung + Jetzt mit 10 %% Rabatt kaufen + Greife auf 13.000+ Kryptowährungen zu. Kaufe, verkaufe, tausche und stake Sie mit einem einzigen Fingertipp.\nVerbinde bis zu drei Karten für ein Backup. + Entdecke die Tangem Wallet Wallet-Einstellungen Tangem Verwende %s oder scanne eine Karte oder Ring, um den Zugriff auf deine Wallet freizuschalten. @@ -998,6 +1007,9 @@ Dieses Token muss mit deinem Hedera-Konto verknüpft sein, bevor du ihn erhalten kannst. Verknüpfe deinen Token Nicht genug %s. Lade dein Hedera-Konto auf, um dieses Token zuzuordnen + Bist Du sicher, dass Du die Transaktion stornieren willst? Du kannst die Transaktion nicht erneut starten. + Deine Transaktion mit einem Betrag von %1$s %2$s wurde nicht abgeschlossen. Du kannst versuchen, diese erneut abzuschließen. + Du hast eine nicht abgeschlossene Transaktion Auf dieser Karte oder Ring sind nur noch %s Unterschriften übrig. Du musst dein gesamtes Guthaben abheben. Geringe Anzahl von Unterschriften Token in verschiedenen Netzwerken können unterschiedliche Adressen haben. Überprüfe bei der Überweisung noch einmal, ob deine Adresse mit der des Netzwerks übereinstimmt. diff --git a/core/res/src/main/res/values-es/strings.xml b/core/res/src/main/res/values-es/strings.xml index ee04d97a2f..b77f4a6456 100644 --- a/core/res/src/main/res/values-es/strings.xml +++ b/core/res/src/main/res/values-es/strings.xml @@ -858,14 +858,14 @@ Saldos mostrados Cancelar Esta operación no está disponible actualmente. Por favor, inténtalo de nuevo más tarde. - Comprar %s no está disponible en este momento. Por favor revise sus actualizaciones. + Comprar %s no está disponible con los proveedores actuales pero estamos trabajando para agregar más opciones. No tiene fondos para vender. Recargue su cuenta para poder vender fondos desde ella. No tienes fondos para enviar. Recarga tu cuenta para poder enviar fondos desde ella. - El servicio de intercambio %s no está disponible en este momento. Por favor consulte nuestras actualizaciones. + El servicio de intercambio %s no está compatible con los proveedores actuales pero estamos trabajando para agregar más opciones. La venta de fondos estará disponible una vez que la(s) transacción(es) pendiente(s) en la red %s se complete El envío de fondos estará disponible una vez que se completen las transacciones pendientes en la red %s. - La venta de %s no está disponible en este momento. Por favor consulte nuestras actualizaciones. - El staking %s no está disponible en este momento. Por favor consulte nuestras actualizaciones. + Vender %s no es compatible con los proveedores actuales, pero estamos trabajando para agregar más opciones. + El staking de %s no es compatible con los proveedores actuales, pero estamos trabajando para agregar más opciones. Generar XPUB Ocultar Está a punto de ocultar este token de la pantalla principal. Puede volver a agregarlo en cualquier momento a través de la página de gestión de tokens. diff --git a/core/res/src/main/res/values-fr/strings.xml b/core/res/src/main/res/values-fr/strings.xml index c9983efdb7..346d3081e5 100644 --- a/core/res/src/main/res/values-fr/strings.xml +++ b/core/res/src/main/res/values-fr/strings.xml @@ -850,14 +850,14 @@ Soldes affichés Annuler Cette opération est actuellement indisponible. Veuillez réessayer plus tard. - L\'achat de %s n\'est pas disponible pour le moment. Veuillez vérifier vos mises à jour. + L\'achat de %s n\'est pas pris en charge par les fournisseurs actuels mais nous travaillons à ajouter davantage d\'options. Vous n\'avez pas de fonds à vendre. Renflouez votre compte pour pouvoir vendre des fonds à partir de celui-ci. Vous n\'avez pas de fonds à envoyer. Renflouez votre compte pour pouvoir envoyer des fonds à partir de celui-ci. - Le service d\'échange %s n\'est pas disponible pour le moment. Veuillez consulter nos mises à jour. + Le service d\'échange %s n\'est pas pris en charge par les fournisseurs actuels mais nous travaillons à ajouter plus d\'options. La vente de fonds sera disponible une fois que la ou les transactions en attente dans le réseau %s seront terminées L\'envoi de fonds sera disponible une fois la ou les transactions en attente dans le réseau %s terminées. - La vente de %s n\'est pas disponible pour le moment. Veuillez consulter nos mises à jour. - Le staking %s n’est pas disponible pour le moment. Veuillez consulter nos mises à jour. + L\'achat de %s n\'est pas pris en charge par les fournisseurs actuels mais nous travaillons à ajouter plus d\'options. + Le staking de %s n\'est pas pris en charge par les fournisseurs actuels, mais nous travaillons à ajouter plus d\'options. Générer XPUB Masquer Vous êtes sur le point de masquer ce jeton de l\'écran principal. Vous pouvez le rajouter à tout moment via la page de gestion des jetons. diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml index e32e1a6fcb..0c5037ec1c 100644 --- a/core/res/src/main/res/values-ja/strings.xml +++ b/core/res/src/main/res/values-ja/strings.xml @@ -291,6 +291,9 @@ このペアは利用できません 許可が必要です 推奨 + %sを買い付けました + %sを買い付けています + %sを買い付けています... トークンが見つかりません。別のリクエストをお試しください。 ID: %s 取引IDをコピーしました @@ -830,7 +833,7 @@ 金額には以下が含まれます: \n • サービス プロバイダーの手数料\n • 取引所からユーザーのアドレスに%1$sを送金するためのネットワーク手数料。 \n\nプロバイダーのスリッページは最大%2$sです この金額には、サービスプロバイダーの手数料が含まれています。 金額にはサービスプロバイダーの手数料が含まれます。 \n\nプロバイダーのスリッページは最大%s です - 手数料 + 情報 すべての分散型取引所は、スマートコントラクトがあなたの許可なくウォレットにアクセスするのを防ぐために承認を必要とします。設計上、スマートコントラクトは承認なしでトークンにアクセスできません。トークンを「ロック解除」することで、あなたは1-inchのスマートコントラクトがトークンを使うことを承認します。ネットワークのマイナーは、このアクションをブロックチェーンに記録するためのガス料金(あなたが支払う)を受け取ります。承認後、トークンを交換することができます。 承認 手数料見積りエラーです。サポートにフィードバックをお送りください。 @@ -846,14 +849,14 @@ 残高表示 元に戻す この操作は現在利用できません。しばらくしてからもう一度お試しください。 - 現在、 %sの買付はご利用いただけません。アップデート情報をご確認ください。 + %sの買付は、現在のプロバイダーではサポートされていませんが、より多くのオプションを追加できるよう取り組んでいます。 売却できる資金がありません。アカウントに入金して、売却できるようにしてください。 送金する資金がありません。アカウントに入金して、送金できるようにしてください。 - 現在、 %sの交換はご利用いただけません。アップデート情報を確認してください。 + %sのスワップは、現在のプロバイダーではサポートされていませんが、より多くのオプションを追加できるよう取り組んでいます。 ネットワーク%s内の保留中の取引が完了すると、資金の売却が可能になります。 ネットワーク%s内の保留中の取引が完了すると、送金が可能になります。 - 現在、 %sの売却はご利用いただけません。アップデート情報をご確認ください。 - %s のステーキングは現在ご利用いただけません。最新情報をご確認ください。 + %sの売却は、現在のプロバイダーではサポートされていませんが、より多くのオプションを追加できるよう取り組んでいます。 + %sのステーキングは、現在のプロバイダーではサポートされていませんが、より多くのオプションを追加できるよう取り組んでいます。 XPUBを生成する 非表示 このトークンをメイン画面から非表示にします。トークンの管理ページからいつでも再度追加できます。 @@ -946,6 +949,7 @@ %sネットワーク アドレスがクリップボードにコピーされました インターネット接続がありません + 今すぐ10 %%オフで購入 1.3万種類以上の暗号資産にアクセス。ワンタップで買付、売却、スワップ、ステーキングが可能です。\nバックアップ用に最大3枚のカードを連携できます。 Tangemウォレットを見る ウォレット設定 @@ -993,6 +997,9 @@ このトークンを受け取るには、Hederaアカウントに関連付ける必要があります。 トークンを関連付ける %sが不足しています。このトークンを関連付けるには、Hederaアカウントに資金を追加してください。 + 取引をキャンセルしてもよろしいですか? 取引を再試行することはできません + %1$s %2$sの取引が完了しませんでした。もう一度試して完了してください。 + 未完了の取引があります このカードには%sの署名のみが残っています。資金をすべて引き出す必要があります。 署名数が少ないです 異なるネットワーク上のトークンは、異なるアドレスを持つ場合があります。資金を送金する際には、アドレスがネットワークと一致していることを再確認してください。 @@ -1018,7 +1025,7 @@ Solanaネットワークが混雑しています。2分以内に取引が完了しない場合は、再度取引を繰り返してください。 Solanaネットワークアラート Solana ネットワークは 2 日ごとに%1$sのレンタル料を請求します。レンタル料を支払えないアカウントはネットワークから削除されます。アカウントに%2$s以上入金すると、無料で使用できます。 - 現在、一部のネットワークにアクセスできません。しばらくしてからもう一度お試しください。 + 下にスワイプして更新するか、後でもう一度お試しください。 一部のネットワークにアクセスできません これはテストネットカードです。取引処理はできませんので、テストおよび開発目的でのみご利用ください。 テスト目的のみ diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index 9f00f71c2c..280a951d4b 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -183,6 +183,7 @@ Условиями использования Сегодня Ошибка транзакции + Статус транзакции Транзакции Перевод Я понял @@ -580,7 +581,7 @@ Для данной валюты нет доступных провайдеров Оплата с Вы сможете завершить транзакцию через сервис стороннего провайдера, %s - Переход к %s ... + Переход к %s... Наши сервисы недоступны в данной стране Настройки Через @@ -965,7 +966,7 @@ Нет соединения с интернетом Получить с 10%% скидкой Получите доступ к более чем 13 000 криптовалют. Покупайте, продавайте, обменяйте и стейкайте в один клик. Свяжите до трех карт для резервного копирования. - Откройте Tangem Wallet + Откройте Tangem Wallet Настройки кошелька Tangem Используйте %s или отсканируйте карту/кольцо, чтобы разблокировать доступ к вашему кошельку @@ -1011,6 +1012,9 @@ Этот токен должен быть ассоциирован с вашей учетной записью Hedera, прежде чем вы сможете его принять Ассоциируете свой токен Недостаточно %s. Пополните ваш аккаунт Hedera для ассоциации этого токена + Вы уверены что хотите отменить эту транзакцию? Вы не сможете отправить ее еще раз + Ваша транзакция %1$s %2$s не была завершена. Вы можете попробовать отправить ее еще раз. + У вас есть незавершенная транзакция На этой карте осталось всего %s подписей. Вам следует вывести все ваши средства. Малое количество подписей Токены на разных сетях могут иметь разные адреса. Пожалуйста, убедитесь при переводе средств, что ваш адрес соответствует сети. diff --git a/core/res/src/main/res/values-uk-rUA/strings.xml b/core/res/src/main/res/values-uk-rUA/strings.xml index 8f07d981bf..c446190dcc 100644 --- a/core/res/src/main/res/values-uk-rUA/strings.xml +++ b/core/res/src/main/res/values-uk-rUA/strings.xml @@ -300,6 +300,9 @@ Недоступно для цієї пари Потрібен дозвіл Рекомендовано + Купив %s + Купівля %s... + Купівля %s... Токенів не знайдено. Будь ласка, спробуйте інший запит ID: %s ID транзакції скопійовано @@ -975,6 +978,9 @@ Мережа %s Адреса скопійована в буфер обміну Немає підключення до інтернету + Отримати з 10%% знижкою + Доступ до 13,000+ криптовалют. Купуйте, продавайте, обмінюйте та стейкайте одним дотиком.\nЗ’єднайте до трьох карток для бекапу. + Відкрийте Tangem Wallet Налаштування гаманця Tangem Використовуйте %s або відскануйте картку/кільце, щоб розблокувати доступ до вашого гаманця @@ -1020,6 +1026,9 @@ Цей токен повинен бути асоційований з вашим обліковим записом Hedera, перш ніж ви зможете його прийняти Асоціюйте свій токен Недостатньо %s. Поповніть ваш обліковий запис Hedera для асоціації цього токена + Ви впевнені, що хочете скасувати цю транзакцію? Ви не зможете відправити її ще раз + Ваша транзакція %1$s %2$s не була завершена. Ви можете спробувати відправити її ще раз. + У вас є незавершена транзакція На цій картці залишається лише %s підписів. Ви повинні вивести всі свої кошти. Низька кількість підписів Токени в різних мережах можуть мати різні адреси. Переконайтеся, що ваша адреса відповідає мережі, коли переказуєте кошти. diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 6978552ae0..08a7924ae5 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -294,6 +294,9 @@ Unavailable for this pair Permission Required Recommended + Bought %s + Buying %s + Buying %s... No tokens found. Please try another request ID: %s Transaction ID copied @@ -1004,6 +1007,9 @@ This token must be associated with your Hedera account before you can receive it Associate your token Not enough %s. Top up your Hedera account to associate this token + Are you sure you want to cancel the transaction? You will not be able to retry the transaction again + Your transaction with an amount of %1$s %2$s was not completed. You can try again to complete it. + You have unfinished transaction Only %s signatures are left on this card. You must withdraw all of your funds. Low signature count Tokens on different networks can have different addresses. Double-check that your address matches the network when you transfer funds. diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/notifications/NoteMigrationNotification.kt b/core/ui/src/main/java/com/tangem/core/ui/components/notifications/NoteMigrationNotification.kt new file mode 100644 index 0000000000..6b5f396f85 --- /dev/null +++ b/core/ui/src/main/java/com/tangem/core/ui/components/notifications/NoteMigrationNotification.kt @@ -0,0 +1,111 @@ +package com.tangem.core.ui.components.notifications + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.* +import androidx.compose.material.Text +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.tangem.core.ui.R +import com.tangem.core.ui.components.buttons.common.TangemButton +import com.tangem.core.ui.components.buttons.common.TangemButtonColors +import com.tangem.core.ui.components.buttons.common.TangemButtonIconPosition +import com.tangem.core.ui.extensions.resolveReference +import com.tangem.core.ui.extensions.stringReference +import com.tangem.core.ui.res.TangemColorPalette +import com.tangem.core.ui.res.TangemColorPalette.Dark6 +import com.tangem.core.ui.res.TangemColorPalette.Light2 +import com.tangem.core.ui.res.TangemTheme +import com.tangem.core.ui.res.TangemThemePreview + +@Composable +fun NoteMigrationNotification(config: NotificationConfig, modifier: Modifier = Modifier) { + val button = config.buttonsState as? NotificationConfig.ButtonsState.SecondaryButtonConfig + button ?: return + + Column( + modifier = modifier + .fillMaxWidth() + .clip(shape = TangemTheme.shapes.roundedCornersXMedium) + .background(TangemColorPalette.Dark6), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Image( + modifier = Modifier.heightIn(max = 146.dp), + painter = painterResource(id = R.drawable.banner_note_migration), + contentDescription = null, + contentScale = ContentScale.Fit, + ) + Column( + modifier = Modifier.padding( + start = 12.dp, + end = 12.dp, + bottom = 12.dp, + ), + verticalArrangement = Arrangement.spacedBy(10.dp), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + config.title?.let { + Text( + text = it.resolveReference(), + color = TangemColorPalette.White, + style = TangemTheme.typography.h3, + ) + } + + Text( + text = config.subtitle.resolveReference(), + textAlign = TextAlign.Center, + color = TangemColorPalette.Light5, + style = TangemTheme.typography.body2, + ) + TangemButton( + modifier = Modifier.fillMaxWidth(), + text = button.text.resolveReference(), + icon = TangemButtonIconPosition.None, + onClick = button.onClick, + colors = TangemButtonColors( + backgroundColor = Light2, + contentColor = Dark6, + disabledBackgroundColor = TangemTheme.colors.button.disabled, + disabledContentColor = TangemTheme.colors.text.disabled, + ), + enabled = true, + textStyle = TangemTheme.typography.subtitle1, + showProgress = false, + ) + } + } +} + +// region Preview +@Preview(showBackground = true, widthDp = 328) +@Composable +private fun NoteMigrationNotification_Preview() { + TangemThemePreview { + NoteMigrationNotification( + NotificationConfig( + title = stringReference("Discover Tangem Wallet"), + subtitle = stringReference( + "Access 13,000+ cryptocurrencies. Buy, sell, swap, and stake with a single tap. Link up to " + + "three cards for a backup.", + ), + iconResId = R.drawable.ic_empty_64, + onCloseClick = { }, + buttonsState = NotificationConfig.ButtonsState.SecondaryButtonConfig( + text = stringReference("Get now"), + onClick = {}, + ), + ), + ) + } +} + +// endregion \ No newline at end of file diff --git a/core/ui/src/main/res/drawable/banner_note_migration.webp b/core/ui/src/main/res/drawable/banner_note_migration.webp new file mode 100644 index 0000000000..6f4f2a0ec6 Binary files /dev/null and b/core/ui/src/main/res/drawable/banner_note_migration.webp differ diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/WalletScreenAnalyticsEvent.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/WalletScreenAnalyticsEvent.kt index bfb7efaf45..39d99aaf63 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/WalletScreenAnalyticsEvent.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/WalletScreenAnalyticsEvent.kt @@ -114,6 +114,10 @@ sealed class WalletScreenAnalyticsEvent { data object BackupError : MainScreen(event = "Notice - Backup Error") + data object NotePromo : MainScreen(event = "Notice - Note Promo") + + data object NotePromoButton : MainScreen(event = "Note Promo Button") + data object UnlockAllWithBiometrics : MainScreen(event = "Button - Unlock All With Biometrics") data object UnlockWithCardScan : MainScreen(event = "Button - Unlock With Card Scan") diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt index fecbf47463..89d0467012 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt @@ -35,6 +35,7 @@ internal class WalletWarningsAnalyticsSender @Inject constructor( return warnings.mapNotNullTo(mutableSetOf(), ::getEvent) } + @Suppress("CyclomaticComplexMethod") private fun getEvent(warning: WalletNotification): AnalyticsEvent? { return when (warning) { is WalletNotification.Critical.DevCard -> MainScreen.DevelopmentCard @@ -46,6 +47,7 @@ internal class WalletWarningsAnalyticsSender @Inject constructor( is WalletNotification.Informational.MissingAddresses -> MainScreen.MissingAddresses is WalletNotification.RateApp -> MainScreen.HowDoYouLikeTangem is WalletNotification.Critical.BackupError -> MainScreen.BackupError + is WalletNotification.NoteMigration -> MainScreen.NotePromo is WalletNotification.SwapPromo -> TokenSwapPromoAnalyticsEvent.NoticePromotionBanner( source = AnalyticsParam.ScreensSources.Main, programName = TokenSwapPromoAnalyticsEvent.ProgramName.OKX, diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetSingleWalletWarningsFactory.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetSingleWalletWarningsFactory.kt index c502e65890..81e435fa5e 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetSingleWalletWarningsFactory.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetSingleWalletWarningsFactory.kt @@ -41,7 +41,7 @@ internal class GetSingleWalletWarningsFactory @Inject constructor( buildList { addCriticalNotifications(cardTypesResolver) - addInformationalNotifications(cardTypesResolver) + addInformationalNotifications(cardTypesResolver, clickIntents) addWarningNotifications( userWallet, @@ -75,7 +75,17 @@ internal class GetSingleWalletWarningsFactory @Inject constructor( } } - private fun MutableList.addInformationalNotifications(cardTypesResolver: CardTypesResolver) { + private fun MutableList.addInformationalNotifications( + cardTypesResolver: CardTypesResolver, + clickIntents: WalletClickIntents, + ) { + addIf( + element = WalletNotification.NoteMigration( + onClick = { clickIntents.onNoteMigrationButtonClick(NOTE_MIGRATION_URL) }, + ), + condition = cardTypesResolver.isTangemNote(), + ) + addIf( element = WalletNotification.Informational.DemoCard, condition = isDemoCardUseCase(cardId = cardTypesResolver.getCardId()), @@ -160,13 +170,17 @@ internal class GetSingleWalletWarningsFactory @Inject constructor( private fun MutableList.addIf(element: WalletNotification, condition: Boolean) { if (condition) { add(element = element) - if (element is WalletNotification.Critical || element is WalletNotification.Warning) { + if (element is WalletNotification.Critical || + element is WalletNotification.Warning || + element is WalletNotification.NoteMigration + ) { readyForRateAppNotification = false } } } private companion object { + const val NOTE_MIGRATION_URL = "https://tangem.com/en/?promocode=Note10" const val MAX_REMAINING_SIGNATURES_COUNT = 10 } } \ No newline at end of file diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotification.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotification.kt index 2741cc56ca..feb796546d 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotification.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotification.kt @@ -2,10 +2,7 @@ package com.tangem.feature.wallet.presentation.wallet.state.model import androidx.compose.runtime.Immutable import com.tangem.core.ui.components.notifications.NotificationConfig -import com.tangem.core.ui.extensions.TextReference -import com.tangem.core.ui.extensions.pluralReference -import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.wrappedList +import com.tangem.core.ui.extensions.* import com.tangem.feature.wallet.impl.R import org.joda.time.DateTime @@ -143,7 +140,7 @@ sealed class WalletNotification(val config: NotificationConfig) { ), ) - object DemoCard : Informational( + data object DemoCard : Informational( title = resourceReference(id = R.string.warning_demo_mode_title), subtitle = resourceReference(id = R.string.warning_demo_mode_message), ) @@ -204,4 +201,16 @@ sealed class WalletNotification(val config: NotificationConfig) { onCloseClick = onCloseClick, ), ) + + data class NoteMigration(val onClick: () -> Unit) : WalletNotification( + config = NotificationConfig( + title = resourceReference(R.string.wallet_promo_banner_title), + subtitle = resourceReference(R.string.wallet_promo_banner_description), + iconResId = R.drawable.banner_note_migration, + buttonsState = NotificationConfig.ButtonsState.SecondaryButtonConfig( + text = resourceReference(R.string.wallet_promo_banner_button_title), + onClick = onClick, + ), + ), + ) } \ No newline at end of file diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletNotifications.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletNotifications.kt index 39dbbb2618..de41263c1e 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletNotifications.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletNotifications.kt @@ -1,9 +1,9 @@ package com.tangem.feature.wallet.presentation.wallet.ui.components.common -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.items import androidx.compose.ui.Modifier +import com.tangem.core.ui.components.notifications.NoteMigrationNotification import com.tangem.core.ui.components.notifications.Notification import com.tangem.core.ui.components.notifications.OkxPromoNotification import com.tangem.core.ui.components.notifications.RingPromoNotification @@ -19,7 +19,6 @@ import kotlinx.collections.immutable.ImmutableList * [REDACTED_AUTHOR] */ -@OptIn(ExperimentalFoundationApi::class) internal fun LazyListScope.notifications(configs: ImmutableList, modifier: Modifier = Modifier) { items( items = configs, @@ -31,16 +30,25 @@ internal fun LazyListScope.notifications(configs: ImmutableList { OkxPromoNotification( config = it.config, - modifier = modifier.animateItemPlacement(), + modifier = modifier.animateItem(), ) } is WalletNotification.RingPromo -> { - RingPromoNotification(config = it.config, modifier = modifier.animateItemPlacement()) + RingPromoNotification( + config = it.config, + modifier = modifier.animateItem(), + ) + } + is WalletNotification.NoteMigration -> { + NoteMigrationNotification( + config = it.config, + modifier = modifier.animateItem(), + ) } else -> { Notification( config = it.config, - modifier = modifier.animateItemPlacement(), + modifier = modifier.animateItem(), iconTint = when (it) { is WalletNotification.Critical -> TangemTheme.colors.icon.warning is WalletNotification.Informational -> TangemTheme.colors.icon.accent diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletWarningsClickIntents.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletWarningsClickIntents.kt index 2db549db07..7669529ac3 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletWarningsClickIntents.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletWarningsClickIntents.kt @@ -67,6 +67,8 @@ internal interface WalletWarningsClickIntents { fun onCloseTravalaPromoClick() fun onSupportClick() + + fun onNoteMigrationButtonClick(url: String) } @Suppress("LongParameterList") @@ -296,6 +298,13 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor( } } + override fun onNoteMigrationButtonClick(url: String) { + analyticsEventHandler.send(MainScreen.NotePromoButton) + viewModelScope.launch(dispatchers.main) { + router.openUrl(url) + } + } + private fun getSelectedUserWallet(): UserWallet? { val userWalletId = stateHolder.getSelectedWalletId() return getUserWalletUseCase(userWalletId).getOrElse { diff --git a/gradle.properties b/gradle.properties index c4b0b8ac32..a312f8c1a2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs = -Xmx6144m -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs = -Xmx6144m -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects