Updated on 2026-08-14
This commit is contained in:
parent
4e63402851
commit
c43432b1ca
7 changed files with 76 additions and 1 deletions
|
|
@ -787,6 +787,8 @@
|
|||
<string name="koinos_mana_level_description">The Koinos network requires Mana for network fees. You have %1$s/%2$s Mana</string>
|
||||
<string name="koinos_mana_level_title">Mana level</string>
|
||||
<string name="main_add_and_manage_tokens">Add & Manage</string>
|
||||
<string name="main_add_funds_promo_description">Deposit crypto or buy with card to get started</string>
|
||||
<string name="main_add_funds_promo_title">Add funds to start earning and trading</string>
|
||||
<string name="main_empty_tokens_list_message">To begin tracking your crypto assets and transactions, add tokens</string>
|
||||
<string name="main_manage_tokens">Manage tokens</string>
|
||||
<string name="main_qr_scan_hint">Scan QR code to send funds or connect to an app</string>
|
||||
|
|
|
|||
13
core/ui/src/main/res/drawable/ic_coins_swap_24.xml
Normal file
13
core/ui/src/main/res/drawable/ic_coins_swap_24.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M8,9.25C11.728,9.25 14.75,12.272 14.75,16C14.75,19.728 11.728,22.75 8,22.75C4.272,22.75 1.25,19.728 1.25,16C1.25,12.272 4.272,9.25 8,9.25ZM7.074,12V12.762H5.55V19.238H7.074V20H8.217V19.238H8.788C9.814,19.238 10.502,18.299 10.502,17.333C10.502,16.841 10.324,16.357 10.014,16C10.324,15.643 10.502,15.158 10.502,14.667C10.502,13.701 9.814,12.762 8.788,12.762H8.217V12H7.074ZM8.788,16.571C9.024,16.571 9.359,16.827 9.359,17.333C9.359,17.84 9.024,18.096 8.788,18.096H6.692V16.571H8.788ZM8.788,13.904C9.024,13.904 9.359,14.16 9.359,14.667C9.359,15.173 9.024,15.429 8.788,15.429H6.692V13.904H8.788Z"
|
||||
android:fillColor="#0099FF"/>
|
||||
<path
|
||||
android:pathData="M15.996,1.25C19.724,1.25 22.746,4.272 22.746,8C22.746,11.498 20.086,14.374 16.678,14.716C16.443,14.739 16.326,14.751 16.233,14.685C16.141,14.618 16.112,14.488 16.056,14.229C15.37,11.094 12.901,8.626 9.766,7.94C9.508,7.884 9.379,7.855 9.312,7.763C9.245,7.67 9.256,7.553 9.28,7.317C9.622,3.91 12.498,1.25 15.996,1.25ZM13.331,6.217H15.293V7.014C13.698,7.082 12.5,7.376 12.5,7.729C12.501,8.081 13.7,8.374 15.293,8.443V11H16.712V8.443C18.303,8.375 19.5,8.081 19.5,7.729C19.499,7.377 18.303,7.083 16.712,7.015L16.711,6.217H18.673V5H13.331V6.217ZM15.292,7.997C15.384,8.003 15.648,8.019 16.013,8.019C16.45,8.019 16.67,8.001 16.711,7.997V7.106C18.117,7.165 19.165,7.393 19.165,7.666C19.164,7.939 18.116,8.167 16.711,8.226V8.224C16.671,8.226 16.465,8.237 16.007,8.237C15.64,8.237 15.383,8.228 15.292,8.224V8.225C13.883,8.167 12.832,7.939 12.832,7.665C12.832,7.392 13.884,7.163 15.292,7.105V7.997Z"
|
||||
android:fillColor="#0099FF"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
|
|
@ -13,6 +13,7 @@ import com.tangem.domain.wallets.usecase.GetSelectedWalletSyncUseCase
|
|||
import com.tangem.domain.wallets.usecase.SelectWalletUseCase
|
||||
import com.tangem.domain.yield.supply.usecase.YieldSupplyApyUpdateUseCase
|
||||
import com.tangem.feature.wallet.presentation.router.InnerWalletRouter
|
||||
import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent
|
||||
import com.tangem.feature.wallet.presentation.wallet.domain.OnrampStatusFactory
|
||||
import com.tangem.feature.wallet.presentation.wallet.domain.WalletContentFetcher
|
||||
import com.tangem.feature.wallet.presentation.wallet.domain.unwrap
|
||||
|
|
@ -123,6 +124,11 @@ internal class WalletClickIntents @Inject constructor(
|
|||
router.openAddFunds(userWalletId)
|
||||
}
|
||||
|
||||
fun onAddFundsPromoClick(userWalletId: UserWalletId) {
|
||||
analyticsEventHandler.send(WalletScreenAnalyticsEvent.MainScreen.ButtonAddFundsPromo())
|
||||
router.openAddFunds(userWalletId)
|
||||
}
|
||||
|
||||
private fun refreshMultiCurrencyContent(showRefreshState: Boolean) {
|
||||
val userWallet = getSelectedWalletSyncUseCase.unwrap() ?: return
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,10 @@ sealed class WalletScreenAnalyticsEvent {
|
|||
|
||||
class BackupError : MainScreen(event = "Notice - Backup Error")
|
||||
|
||||
class NoticeAddFunds : MainScreen(event = "Notice - Add Funds")
|
||||
|
||||
class ButtonAddFundsPromo : MainScreen(event = "Button - Add Funds Promo")
|
||||
|
||||
class NotePromo : MainScreen(event = "Notice - Note Promo")
|
||||
|
||||
class NotePromoButton : MainScreen(event = "Note Promo Button")
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ internal class WalletWarningsAnalyticsSender @Inject constructor(
|
|||
)
|
||||
}
|
||||
is WalletNotificationUM.PushNotifications -> PushBanner()
|
||||
is WalletNotificationUM.AddFunds -> NoticeAddFunds()
|
||||
is WalletNotificationUM.UnlockWallets,
|
||||
is WalletNotificationUM.NoAccount,
|
||||
is WalletNotificationUM.LowSignatures,
|
||||
|
|
|
|||
|
|
@ -64,9 +64,17 @@ internal class GetWalletNotificationsFactory @Inject constructor(
|
|||
.filterIsInstance<AccountStatus.Payment>()
|
||||
.firstOrNull()
|
||||
|
||||
val isAddFundsBannerShown = isAddFundsBannerVisible(totalFiatBalance)
|
||||
|
||||
buildList {
|
||||
addUsedOutdatedDataNotification(totalFiatBalance)
|
||||
|
||||
addAddFundsBanner(
|
||||
isVisible = isAddFundsBannerShown,
|
||||
userWallet = userWallet,
|
||||
clickIntents = clickIntents,
|
||||
)
|
||||
|
||||
addCriticalNotifications(userWallet, clickIntents)
|
||||
|
||||
addFinishWalletActivationNotification(
|
||||
|
|
@ -87,7 +95,7 @@ internal class GetWalletNotificationsFactory @Inject constructor(
|
|||
userWallet = userWallet,
|
||||
cardTypesResolver = cardTypesResolver,
|
||||
flattenCurrencies = flattenCurrencies,
|
||||
isNeedToBackup = isNeedToBackup,
|
||||
isNeedToBackup = isNeedToBackup && !isAddFundsBannerShown,
|
||||
clickIntents = clickIntents,
|
||||
)
|
||||
|
||||
|
|
@ -109,6 +117,24 @@ internal class GetWalletNotificationsFactory @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
private fun isAddFundsBannerVisible(totalFiatBalance: TotalFiatBalance): Boolean {
|
||||
val loaded = totalFiatBalance as? TotalFiatBalance.Loaded ?: return false
|
||||
return loaded.amount.orZero().signum() == 0
|
||||
}
|
||||
|
||||
private fun MutableList<WalletNotificationUM>.addAddFundsBanner(
|
||||
isVisible: Boolean,
|
||||
userWallet: UserWallet,
|
||||
clickIntents: WalletClickIntents,
|
||||
) {
|
||||
addIf(
|
||||
element = WalletNotificationUM.AddFunds(
|
||||
onClick = { clickIntents.onAddFundsPromoClick(userWallet.walletId) },
|
||||
),
|
||||
condition = isVisible,
|
||||
)
|
||||
}
|
||||
|
||||
private fun MutableList<WalletNotificationUM>.addCriticalNotifications(
|
||||
userWallet: UserWallet,
|
||||
clickIntents: WalletClickIntents,
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import com.tangem.core.ui.extensions.*
|
|||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.feature.wallet.impl.R
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import com.tangem.core.res.R as CoreResR
|
||||
import com.tangem.core.ui.R as CoreUiR
|
||||
|
||||
/**
|
||||
* Wallet notification types
|
||||
|
|
@ -342,6 +344,27 @@ internal sealed class WalletNotificationUM(val messageUM: TangemMessageUM, val t
|
|||
// endregion
|
||||
|
||||
// region Promo
|
||||
data class AddFunds(val onClick: () -> Unit) : WalletNotificationUM(
|
||||
messageUM = TangemMessageUM(
|
||||
id = "AddFundsPromoNotification",
|
||||
title = resourceReference(id = CoreResR.string.main_add_funds_promo_title),
|
||||
subtitle = resourceReference(id = CoreResR.string.main_add_funds_promo_description),
|
||||
iconUM = TangemIconUM.Icon(
|
||||
iconRes = CoreUiR.drawable.ic_coins_swap_24,
|
||||
tintReference = { TangemTheme.colors2.graphic.status.accent },
|
||||
),
|
||||
messageEffect = TangemMessageEffect.None,
|
||||
buttonsUM = persistentListOf(
|
||||
TangemMessageButtonUM(
|
||||
text = resourceReference(id = CoreResR.string.common_add_funds),
|
||||
type = TangemButtonType.Secondary,
|
||||
onClick = onClick,
|
||||
),
|
||||
),
|
||||
),
|
||||
type = WalletNotificationType.Promo,
|
||||
)
|
||||
|
||||
data class NoteMigration(val onClick: () -> Unit) : WalletNotificationUM(
|
||||
messageUM = TangemMessageUM(
|
||||
id = "NoteMigrationNotification",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue