Updated on 2026-08-14
This commit is contained in:
commit
e98289db09
93 changed files with 352 additions and 189 deletions
|
|
@ -30,6 +30,7 @@ dependencies {
|
||||||
implementation(project(":domain:wallets:models"))
|
implementation(project(":domain:wallets:models"))
|
||||||
implementation(project(":common"))
|
implementation(project(":common"))
|
||||||
implementation(project(":core:analytics"))
|
implementation(project(":core:analytics"))
|
||||||
|
implementation(project(":core:navigation"))
|
||||||
implementation(project(":core:featuretoggles"))
|
implementation(project(":core:featuretoggles"))
|
||||||
implementation(project(":core:res"))
|
implementation(project(":core:res"))
|
||||||
implementation(project(":core:ui"))
|
implementation(project(":core:ui"))
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,11 @@ package com.tangem.tap
|
||||||
import androidx.lifecycle.DefaultLifecycleObserver
|
import androidx.lifecycle.DefaultLifecycleObserver
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.userWalletList.asLockable
|
import com.tangem.tap.domain.userWalletList.asLockable
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.Job
|
|
||||||
import kotlinx.coroutines.delay
|
|
||||||
import kotlinx.coroutines.isActive
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import kotlin.time.Duration
|
import kotlin.time.Duration
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ import androidx.core.view.WindowInsetsControllerCompat
|
||||||
import by.kirich1409.viewbindingdelegate.viewBinding
|
import by.kirich1409.viewbindingdelegate.viewBinding
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import com.tangem.TangemSdk
|
import com.tangem.TangemSdk
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.card.ScanCardUseCase
|
import com.tangem.domain.card.ScanCardUseCase
|
||||||
import com.tangem.domain.wallets.legacy.UserWalletsListManager
|
import com.tangem.domain.wallets.legacy.UserWalletsListManager
|
||||||
import com.tangem.features.tester.api.TesterRouter
|
import com.tangem.features.tester.api.TesterRouter
|
||||||
|
|
@ -25,8 +27,6 @@ import com.tangem.tap.common.SnackbarHandler
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.redux.NotificationsHandler
|
import com.tangem.tap.common.redux.NotificationsHandler
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.common.shop.googlepay.GooglePayService
|
import com.tangem.tap.common.shop.googlepay.GooglePayService
|
||||||
import com.tangem.tap.common.shop.googlepay.GooglePayService.Companion.LOAD_PAYMENT_DATA_REQUEST_CODE
|
import com.tangem.tap.common.shop.googlepay.GooglePayService.Companion.LOAD_PAYMENT_DATA_REQUEST_CODE
|
||||||
import com.tangem.tap.common.shop.googlepay.GooglePayUtil.createPaymentsClient
|
import com.tangem.tap.common.shop.googlepay.GooglePayUtil.createPaymentsClient
|
||||||
|
|
|
||||||
|
|
@ -156,5 +156,6 @@ sealed class AnalyticsParam {
|
||||||
const val ERROR_CODE = "Error Code"
|
const val ERROR_CODE = "Error Code"
|
||||||
const val ERROR_KEY = "Error Key"
|
const val ERROR_KEY = "Error Key"
|
||||||
const val CREATION_TYPE = "Creation type"
|
const val CREATION_TYPE = "Creation type"
|
||||||
|
const val DAPP_NAME = "DApp Name"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -12,7 +12,13 @@ sealed class WalletConnect(
|
||||||
) : AnalyticsEvent("Wallet Connect", event, params, error) {
|
) : AnalyticsEvent("Wallet Connect", event, params, error) {
|
||||||
|
|
||||||
class ScreenOpened : WalletConnect(event = "WC Screen Opened")
|
class ScreenOpened : WalletConnect(event = "WC Screen Opened")
|
||||||
class NewSessionEstablished : WalletConnect("New Session Established")
|
class NewSessionEstablished(dAppName: String) : WalletConnect(
|
||||||
|
event = "New Session Established",
|
||||||
|
params = mapOf(
|
||||||
|
AnalyticsParam.DAPP_NAME to dAppName,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
class SessionDisconnected : WalletConnect("Session Disconnected")
|
class SessionDisconnected : WalletConnect("Session Disconnected")
|
||||||
class RequestSigned : WalletConnect("Request Signed")
|
class RequestSigned : WalletConnect("Request Signed")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.tangem.tap.common.di.domain.wallets
|
||||||
|
|
||||||
|
import com.tangem.domain.wallets.legacy.WalletsStateHolder
|
||||||
|
import com.tangem.domain.wallets.usecase.GetWalletsUseCase
|
||||||
|
import dagger.Module
|
||||||
|
import dagger.Provides
|
||||||
|
import dagger.hilt.InstallIn
|
||||||
|
import dagger.hilt.android.components.ViewModelComponent
|
||||||
|
import dagger.hilt.android.scopes.ViewModelScoped
|
||||||
|
|
||||||
|
@Module
|
||||||
|
@InstallIn(ViewModelComponent::class)
|
||||||
|
object WalletsDomainModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@ViewModelScoped
|
||||||
|
fun providesGetWalletsUseCase(walletsStateHolder: WalletsStateHolder): GetWalletsUseCase {
|
||||||
|
return GetWalletsUseCase(walletsStateHolder = walletsStateHolder)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,10 +2,10 @@ package com.tangem.tap.common.extensions
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.fragment.app.*
|
import androidx.fragment.app.*
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.FragmentShareTransition
|
||||||
import com.tangem.feature.referral.ReferralFragment
|
import com.tangem.feature.referral.ReferralFragment
|
||||||
import com.tangem.feature.swap.presentation.SwapFragment
|
import com.tangem.feature.swap.presentation.SwapFragment
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.FragmentShareTransition
|
|
||||||
import com.tangem.tap.features.customtoken.legacy.AddCustomTokenFragment
|
import com.tangem.tap.features.customtoken.legacy.AddCustomTokenFragment
|
||||||
import com.tangem.tap.features.details.ui.appsettings.AppSettingsFragment
|
import com.tangem.tap.features.details.ui.appsettings.AppSettingsFragment
|
||||||
import com.tangem.tap.features.details.ui.cardsettings.CardSettingsFragment
|
import com.tangem.tap.features.details.ui.cardsettings.CardSettingsFragment
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.tangem.tap.common.extensions
|
package com.tangem.tap.common.extensions
|
||||||
|
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.extensions.withMainContext
|
import com.tangem.domain.common.extensions.withMainContext
|
||||||
import com.tangem.domain.wallets.models.UserWallet
|
import com.tangem.domain.wallets.models.UserWallet
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.StateDialog
|
import com.tangem.tap.common.redux.StateDialog
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.TapError
|
import com.tangem.tap.domain.TapError
|
||||||
import com.tangem.tap.scope
|
import com.tangem.tap.scope
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.tangem.tap.common.redux
|
package com.tangem.tap.common.redux
|
||||||
|
|
||||||
|
import com.tangem.core.navigation.NavigationState
|
||||||
import com.tangem.domain.redux.DomainState
|
import com.tangem.domain.redux.DomainState
|
||||||
import com.tangem.domain.redux.domainStore
|
import com.tangem.domain.redux.domainStore
|
||||||
import com.tangem.domain.redux.global.NetworkServices
|
import com.tangem.domain.redux.global.NetworkServices
|
||||||
import com.tangem.tap.common.redux.global.GlobalMiddleware
|
import com.tangem.tap.common.redux.global.GlobalMiddleware
|
||||||
import com.tangem.tap.common.redux.global.GlobalState
|
import com.tangem.tap.common.redux.global.GlobalState
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationState
|
|
||||||
import com.tangem.tap.common.redux.navigation.navigationMiddleware
|
import com.tangem.tap.common.redux.navigation.navigationMiddleware
|
||||||
import com.tangem.tap.features.details.redux.DetailsMiddleware
|
import com.tangem.tap.features.details.redux.DetailsMiddleware
|
||||||
import com.tangem.tap.features.details.redux.DetailsState
|
import com.tangem.tap.features.details.redux.DetailsState
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import android.content.Intent
|
||||||
import android.hardware.biometrics.BiometricManager
|
import android.hardware.biometrics.BiometricManager
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.activityResultCaller
|
import com.tangem.tap.activityResultCaller
|
||||||
import com.tangem.tap.common.CustomTabsManager
|
import com.tangem.tap.common.CustomTabsManager
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.tangem.tap.common.redux.navigation
|
package com.tangem.tap.common.redux.navigation
|
||||||
|
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
|
import com.tangem.core.navigation.NavigationState
|
||||||
import com.tangem.tap.common.extensions.getPreviousScreen
|
import com.tangem.tap.common.extensions.getPreviousScreen
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import org.rekotlin.Action
|
import org.rekotlin.Action
|
||||||
|
|
|
||||||
23
app/src/main/java/com/tangem/tap/di/AppStateHolderModule.kt
Normal file
23
app/src/main/java/com/tangem/tap/di/AppStateHolderModule.kt
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.tangem.tap.di
|
||||||
|
|
||||||
|
import com.tangem.core.navigation.NavigationStateHolder
|
||||||
|
import com.tangem.domain.wallets.legacy.WalletsStateHolder
|
||||||
|
import com.tangem.tap.proxy.AppStateHolder
|
||||||
|
import dagger.Binds
|
||||||
|
import dagger.Module
|
||||||
|
import dagger.hilt.InstallIn
|
||||||
|
import dagger.hilt.components.SingletonComponent
|
||||||
|
import javax.inject.Singleton
|
||||||
|
|
||||||
|
@Module
|
||||||
|
@InstallIn(SingletonComponent::class)
|
||||||
|
internal interface AppStateHolderModule {
|
||||||
|
|
||||||
|
@Binds
|
||||||
|
@Singleton
|
||||||
|
fun bindsWalletsStateHolder(appStateHolder: AppStateHolder): WalletsStateHolder
|
||||||
|
|
||||||
|
@Binds
|
||||||
|
@Singleton
|
||||||
|
fun bindsNavigationStateHolder(appStateHolder: AppStateHolder): NavigationStateHolder
|
||||||
|
}
|
||||||
|
|
@ -7,6 +7,8 @@ import com.tangem.common.doOnFailure
|
||||||
import com.tangem.common.doOnSuccess
|
import com.tangem.common.doOnSuccess
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
import com.tangem.core.analytics.AnalyticsEvent
|
import com.tangem.core.analytics.AnalyticsEvent
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.extensions.withMainContext
|
import com.tangem.domain.common.extensions.withMainContext
|
||||||
import com.tangem.domain.common.util.twinsIsTwinned
|
import com.tangem.domain.common.util.twinsIsTwinned
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
|
|
@ -14,8 +16,6 @@ import com.tangem.tap.*
|
||||||
import com.tangem.tap.common.analytics.paramsInterceptor.CardContextInterceptor
|
import com.tangem.tap.common.analytics.paramsInterceptor.CardContextInterceptor
|
||||||
import com.tangem.tap.common.extensions.*
|
import com.tangem.tap.common.extensions.*
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.disclaimer.createDisclaimer
|
import com.tangem.tap.features.disclaimer.createDisclaimer
|
||||||
import com.tangem.tap.features.disclaimer.redux.DisclaimerAction
|
import com.tangem.tap.features.disclaimer.redux.DisclaimerAction
|
||||||
import com.tangem.tap.features.disclaimer.redux.DisclaimerCallback
|
import com.tangem.tap.features.disclaimer.redux.DisclaimerCallback
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@ import arrow.fx.coroutines.resourceScope
|
||||||
import com.tangem.common.CompletionResult
|
import com.tangem.common.CompletionResult
|
||||||
import com.tangem.common.core.TangemError
|
import com.tangem.common.core.TangemError
|
||||||
import com.tangem.core.analytics.AnalyticsEvent
|
import com.tangem.core.analytics.AnalyticsEvent
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.card.ScanCardException
|
import com.tangem.domain.card.ScanCardException
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE
|
import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.scanCard.chains.*
|
import com.tangem.tap.domain.scanCard.chains.*
|
||||||
import com.tangem.tap.domain.scanCard.utils.ScanCardExceptionConverter
|
import com.tangem.tap.domain.scanCard.utils.ScanCardExceptionConverter
|
||||||
import com.tangem.tap.preferencesStorage
|
import com.tangem.tap.preferencesStorage
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import arrow.core.Either
|
||||||
import arrow.core.left
|
import arrow.core.left
|
||||||
import arrow.core.right
|
import arrow.core.right
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
import com.tangem.data.source.preferences.PreferencesDataSource
|
import com.tangem.data.source.preferences.PreferencesDataSource
|
||||||
import com.tangem.domain.card.ScanCardException
|
import com.tangem.domain.card.ScanCardException
|
||||||
import com.tangem.domain.common.util.twinsIsTwinned
|
import com.tangem.domain.common.util.twinsIsTwinned
|
||||||
|
|
@ -15,7 +16,6 @@ import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.extensions.setContext
|
import com.tangem.tap.common.extensions.setContext
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.domain.TapWalletManager
|
import com.tangem.tap.domain.TapWalletManager
|
||||||
import com.tangem.tap.features.onboarding.OnboardingHelper
|
import com.tangem.tap.features.onboarding.OnboardingHelper
|
||||||
import com.tangem.tap.features.onboarding.products.twins.redux.TwinCardsAction
|
import com.tangem.tap.features.onboarding.products.twins.redux.TwinCardsAction
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@ package com.tangem.tap.domain.scanCard.chains
|
||||||
import arrow.core.Either
|
import arrow.core.Either
|
||||||
import arrow.core.left
|
import arrow.core.left
|
||||||
import arrow.core.right
|
import arrow.core.right
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
import com.tangem.domain.card.ScanCardException
|
import com.tangem.domain.card.ScanCardException
|
||||||
import com.tangem.domain.core.chain.Chain
|
import com.tangem.domain.core.chain.Chain
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.features.disclaimer.Disclaimer
|
import com.tangem.tap.features.disclaimer.Disclaimer
|
||||||
import com.tangem.tap.features.disclaimer.createDisclaimer
|
import com.tangem.tap.features.disclaimer.createDisclaimer
|
||||||
import com.tangem.tap.features.disclaimer.redux.DisclaimerAction
|
import com.tangem.tap.features.disclaimer.redux.DisclaimerAction
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.tangem.tap.domain.scanCard.chains
|
package com.tangem.tap.domain.scanCard.chains
|
||||||
|
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
import com.tangem.domain.card.ScanCardException
|
import com.tangem.domain.card.ScanCardException
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
|
|
||||||
sealed class ScanChainException : ScanCardException.ChainException() {
|
sealed class ScanChainException : ScanCardException.ChainException() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,7 @@ class ResetToFactorySettingsTask : CardSessionRunnable<Card> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun resetBackup(session: CardSession, callback: (result: CompletionResult<Card>) -> Unit) {
|
private fun resetBackup(session: CardSession, callback: (result: CompletionResult<Card>) -> Unit) {
|
||||||
val backupStatus = session.environment.card?.backupStatus
|
if (session.environment.card?.backupStatus?.isActive != true) {
|
||||||
if (backupStatus == null || backupStatus == Card.BackupStatus.NoBackup) {
|
|
||||||
callback(CompletionResult.Success(session.environment.card!!))
|
callback(CompletionResult.Success(session.environment.card!!))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -395,7 +395,7 @@ class WalletConnectManager {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Analytics.send(WalletConnect.NewSessionEstablished())
|
Analytics.send(WalletConnect.NewSessionEstablished(""))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.tangem.tap.domain.walletconnect2.data
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import arrow.core.flatten
|
import arrow.core.flatten
|
||||||
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.tap.common.analytics.events.WalletConnect
|
||||||
import com.tangem.tap.domain.walletconnect2.domain.WalletConnectRepository
|
import com.tangem.tap.domain.walletconnect2.domain.WalletConnectRepository
|
||||||
import com.tangem.tap.domain.walletconnect2.domain.WcJrpcRequestsDeserializer
|
import com.tangem.tap.domain.walletconnect2.domain.WcJrpcRequestsDeserializer
|
||||||
import com.tangem.tap.domain.walletconnect2.domain.models.*
|
import com.tangem.tap.domain.walletconnect2.domain.models.*
|
||||||
|
|
@ -237,6 +239,7 @@ class WalletConnectRepositoryImpl @Inject constructor(
|
||||||
params = sessionApproval,
|
params = sessionApproval,
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
Timber.d("Approved successfully: $it")
|
Timber.d("Approved successfully: $it")
|
||||||
|
Analytics.send(WalletConnect.NewSessionEstablished(sessionProposal.name))
|
||||||
},
|
},
|
||||||
onError = {
|
onError = {
|
||||||
Timber.d("Error while approving: $it")
|
Timber.d("Error while approving: $it")
|
||||||
|
|
@ -261,7 +264,9 @@ class WalletConnectRepositoryImpl @Inject constructor(
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onSuccess = {},
|
onSuccess = {},
|
||||||
onError = {},
|
onError = {
|
||||||
|
Analytics.send(WalletConnect.TransactionError(it.throwable))
|
||||||
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -299,6 +304,7 @@ class WalletConnectRepositoryImpl @Inject constructor(
|
||||||
Web3Wallet.disconnectSession(
|
Web3Wallet.disconnectSession(
|
||||||
params = Wallet.Params.SessionDisconnect(topic),
|
params = Wallet.Params.SessionDisconnect(topic),
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
|
Analytics.send(WalletConnect.SessionDisconnected())
|
||||||
updateSessions()
|
updateSessions()
|
||||||
Timber.d("Disconnected successfully: $it")
|
Timber.d("Disconnected successfully: $it")
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.tangem.tap.domain.walletconnect2.domain
|
package com.tangem.tap.domain.walletconnect2.domain
|
||||||
|
|
||||||
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.tap.common.analytics.events.WalletConnect
|
||||||
import com.tangem.tap.common.extensions.filterNotNull
|
import com.tangem.tap.common.extensions.filterNotNull
|
||||||
import com.tangem.tap.domain.walletconnect.WalletConnectSdkHelper
|
import com.tangem.tap.domain.walletconnect.WalletConnectSdkHelper
|
||||||
import com.tangem.tap.domain.walletconnect2.domain.models.*
|
import com.tangem.tap.domain.walletconnect2.domain.models.*
|
||||||
|
|
@ -216,6 +218,7 @@ class WalletConnectInteractor(
|
||||||
id = request.requestId,
|
id = request.requestId,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
Analytics.send(WalletConnect.RequestSigned())
|
||||||
walletConnectRepository.sendRequest(
|
walletConnectRepository.sendRequest(
|
||||||
topic = request.topic,
|
topic = request.topic,
|
||||||
id = request.requestId,
|
id = request.requestId,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import androidx.lifecycle.Lifecycle
|
||||||
import androidx.transition.TransitionInflater
|
import androidx.transition.TransitionInflater
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import com.tangem.common.extensions.VoidCallback
|
import com.tangem.common.extensions.VoidCallback
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
import com.tangem.wallet.R
|
import com.tangem.wallet.R
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.tangem.tap.features.customtoken.impl.presentation.routers
|
package com.tangem.tap.features.customtoken.impl.presentation.routers
|
||||||
|
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
import com.tangem.core.navigation.AppScreen
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
|
|
||||||
/** Default implementation of custom token feature router */
|
/** Default implementation of custom token feature router */
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import com.tangem.common.doOnSuccess
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
import com.tangem.common.flatMap
|
import com.tangem.common.flatMap
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.TapWorkarounds.isTangemTwins
|
import com.tangem.domain.common.TapWorkarounds.isTangemTwins
|
||||||
import com.tangem.domain.common.util.cardTypesResolver
|
import com.tangem.domain.common.util.cardTypesResolver
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
|
|
@ -21,8 +23,6 @@ import com.tangem.tap.common.extensions.onUserWalletSelected
|
||||||
import com.tangem.tap.common.redux.AppDialog
|
import com.tangem.tap.common.redux.AppDialog
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
||||||
import com.tangem.tap.domain.model.builders.UserWalletIdBuilder
|
import com.tangem.tap.domain.model.builders.UserWalletIdBuilder
|
||||||
import com.tangem.tap.domain.scanCard.ScanCardProcessor
|
import com.tangem.tap.domain.scanCard.ScanCardProcessor
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import com.tangem.blockchain.common.Blockchain
|
||||||
import com.tangem.blockchain.common.DerivationStyle
|
import com.tangem.blockchain.common.DerivationStyle
|
||||||
import com.tangem.blockchain.common.WalletManager
|
import com.tangem.blockchain.common.WalletManager
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.BlockchainNetwork
|
import com.tangem.domain.common.BlockchainNetwork
|
||||||
import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
||||||
import com.tangem.domain.common.extensions.fromNetworkId
|
import com.tangem.domain.common.extensions.fromNetworkId
|
||||||
|
|
@ -15,8 +17,6 @@ import com.tangem.domain.models.scan.ScanResponse
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.walletconnect.BnbHelper
|
import com.tangem.tap.domain.walletconnect.BnbHelper
|
||||||
import com.tangem.tap.domain.walletconnect.WalletConnectManager
|
import com.tangem.tap.domain.walletconnect.WalletConnectManager
|
||||||
import com.tangem.tap.domain.walletconnect.WalletConnectNetworkUtils
|
import com.tangem.tap.domain.walletconnect.WalletConnectNetworkUtils
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.ui.platform.ComposeView
|
import androidx.compose.ui.platform.ComposeView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.transition.TransitionInflater
|
import androidx.transition.TransitionInflater
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.details.redux.DetailsAction
|
import com.tangem.tap.features.details.redux.DetailsAction
|
||||||
import com.tangem.tap.features.details.redux.DetailsState
|
import com.tangem.tap.features.details.redux.DetailsState
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.ui.platform.ComposeView
|
import androidx.compose.ui.platform.ComposeView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.transition.TransitionInflater
|
import androidx.transition.TransitionInflater
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.details.redux.DetailsAction
|
import com.tangem.tap.features.details.redux.DetailsAction
|
||||||
import com.tangem.tap.features.details.redux.DetailsState
|
import com.tangem.tap.features.details.redux.DetailsState
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.ui.platform.ComposeView
|
import androidx.compose.ui.platform.ComposeView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.transition.TransitionInflater
|
import androidx.transition.TransitionInflater
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.details.redux.DetailsState
|
import com.tangem.tap.features.details.redux.DetailsState
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
import com.tangem.wallet.R
|
import com.tangem.wallet.R
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,12 @@ import androidx.compose.ui.platform.ComposeView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.transition.TransitionInflater
|
import androidx.transition.TransitionInflater
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.tap.common.analytics.events.Settings
|
import com.tangem.tap.common.analytics.events.Settings
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.details.redux.DetailsState
|
import com.tangem.tap.features.details.redux.DetailsState
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
|
import com.tangem.wallet.R
|
||||||
import org.rekotlin.StoreSubscriber
|
import org.rekotlin.StoreSubscriber
|
||||||
|
|
||||||
class DetailsFragment : Fragment(), StoreSubscriber<DetailsState> {
|
class DetailsFragment : Fragment(), StoreSubscriber<DetailsState> {
|
||||||
|
|
@ -23,8 +24,8 @@ class DetailsFragment : Fragment(), StoreSubscriber<DetailsState> {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
Analytics.send(Settings.ScreenOpened())
|
Analytics.send(Settings.ScreenOpened())
|
||||||
val inflater = TransitionInflater.from(requireContext())
|
val inflater = TransitionInflater.from(requireContext())
|
||||||
enterTransition = inflater.inflateTransition(android.R.transition.fade)
|
enterTransition = inflater.inflateTransition(R.transition.fade)
|
||||||
exitTransition = inflater.inflateTransition(android.R.transition.fade)
|
exitTransition = inflater.inflateTransition(R.transition.fade)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@ package com.tangem.tap.features.details.ui.details
|
||||||
import androidx.compose.runtime.MutableState
|
import androidx.compose.runtime.MutableState
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.util.cardTypesResolver
|
import com.tangem.domain.common.util.cardTypesResolver
|
||||||
import com.tangem.tap.common.analytics.events.Settings
|
import com.tangem.tap.common.analytics.events.Settings
|
||||||
import com.tangem.tap.common.feedback.FeedbackEmail
|
import com.tangem.tap.common.feedback.FeedbackEmail
|
||||||
import com.tangem.tap.common.feedback.SupportInfo
|
import com.tangem.tap.common.feedback.SupportInfo
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.details.redux.DetailsState
|
import com.tangem.tap.features.details.redux.DetailsState
|
||||||
import com.tangem.tap.features.disclaimer.redux.DisclaimerAction
|
import com.tangem.tap.features.disclaimer.redux.DisclaimerAction
|
||||||
import com.tangem.tap.features.home.LocaleRegionProvider
|
import com.tangem.tap.features.home.LocaleRegionProvider
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.ui.platform.ComposeView
|
import androidx.compose.ui.platform.ComposeView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.transition.TransitionInflater
|
import androidx.transition.TransitionInflater
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.details.redux.DetailsState
|
import com.tangem.tap.features.details.redux.DetailsState
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
import org.rekotlin.StoreSubscriber
|
import org.rekotlin.StoreSubscriber
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.ui.platform.ComposeView
|
import androidx.compose.ui.platform.ComposeView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.transition.TransitionInflater
|
import androidx.transition.TransitionInflater
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.details.redux.DetailsState
|
import com.tangem.tap.features.details.redux.DetailsState
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
import org.rekotlin.StoreSubscriber
|
import org.rekotlin.StoreSubscriber
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import androidx.core.view.WindowCompat
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import com.google.zxing.Result
|
import com.google.zxing.Result
|
||||||
import com.otaliastudios.cameraview.CameraView
|
import com.otaliastudios.cameraview.CameraView
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectAction
|
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectAction
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
import me.dm7.barcodescanner.zxing.ZXingScannerView
|
import me.dm7.barcodescanner.zxing.ZXingScannerView
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@ import androidx.compose.ui.platform.ComposeView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.transition.TransitionInflater
|
import androidx.transition.TransitionInflater
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.tap.common.analytics.events.WalletConnect
|
import com.tangem.tap.common.analytics.events.WalletConnect
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectAction
|
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectAction
|
||||||
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectState
|
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectState
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ package com.tangem.tap.features.details.ui.walletconnect.dialogs
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectAction
|
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectAction
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
import com.tangem.wallet.R
|
import com.tangem.wallet.R
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.tangem.tap.features.disclaimer.redux
|
package com.tangem.tap.features.disclaimer.redux
|
||||||
|
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
import com.tangem.core.navigation.AppScreen
|
||||||
import com.tangem.tap.features.disclaimer.Disclaimer
|
import com.tangem.tap.features.disclaimer.Disclaimer
|
||||||
import com.tangem.tap.features.wallet.redux.ProgressState
|
import com.tangem.tap.features.wallet.redux.ProgressState
|
||||||
import org.rekotlin.Action
|
import org.rekotlin.Action
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package com.tangem.tap.features.disclaimer.redux
|
package com.tangem.tap.features.disclaimer.redux
|
||||||
|
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
import org.rekotlin.Action
|
import org.rekotlin.Action
|
||||||
import org.rekotlin.Middleware
|
import org.rekotlin.Middleware
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.tangem.tap.features.disclaimer.redux
|
package com.tangem.tap.features.disclaimer.redux
|
||||||
|
|
||||||
import com.tangem.common.extensions.VoidCallback
|
import com.tangem.common.extensions.VoidCallback
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
import com.tangem.core.navigation.AppScreen
|
||||||
import com.tangem.tap.features.disclaimer.Disclaimer
|
import com.tangem.tap.features.disclaimer.Disclaimer
|
||||||
import com.tangem.tap.features.disclaimer.DummyDisclaimer
|
import com.tangem.tap.features.disclaimer.DummyDisclaimer
|
||||||
import com.tangem.tap.features.wallet.redux.ProgressState
|
import com.tangem.tap.features.wallet.redux.ProgressState
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ import android.view.View.OVER_SCROLL_NEVER
|
||||||
import android.webkit.WebView
|
import android.webkit.WebView
|
||||||
import androidx.transition.TransitionInflater
|
import androidx.transition.TransitionInflater
|
||||||
import by.kirich1409.viewbindingdelegate.viewBinding
|
import by.kirich1409.viewbindingdelegate.viewBinding
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
import com.tangem.core.ui.fragments.setStatusBarColor
|
import com.tangem.core.ui.fragments.setStatusBarColor
|
||||||
import com.tangem.tap.common.extensions.beginDelayedTransition
|
import com.tangem.tap.common.extensions.beginDelayedTransition
|
||||||
import com.tangem.tap.common.extensions.hide
|
import com.tangem.tap.common.extensions.hide
|
||||||
import com.tangem.tap.common.extensions.show
|
import com.tangem.tap.common.extensions.show
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.features.BaseFragment
|
import com.tangem.tap.features.BaseFragment
|
||||||
import com.tangem.tap.features.addBackPressHandler
|
import com.tangem.tap.features.addBackPressHandler
|
||||||
import com.tangem.tap.features.disclaimer.Disclaimer
|
import com.tangem.tap.features.disclaimer.Disclaimer
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@ import androidx.core.view.WindowInsetsControllerCompat
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.feature.learn2earn.presentation.Learn2earnViewModel
|
import com.tangem.feature.learn2earn.presentation.Learn2earnViewModel
|
||||||
import com.tangem.tap.common.analytics.events.IntroductionProcess
|
import com.tangem.tap.common.analytics.events.IntroductionProcess
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.home.compose.StoriesScreen
|
import com.tangem.tap.features.home.compose.StoriesScreen
|
||||||
import com.tangem.tap.features.home.redux.HomeAction
|
import com.tangem.tap.features.home.redux.HomeAction
|
||||||
import com.tangem.tap.features.home.redux.HomeState
|
import com.tangem.tap.features.home.redux.HomeState
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import com.tangem.common.doOnSuccess
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
import com.tangem.core.analytics.AnalyticsEvent
|
import com.tangem.core.analytics.AnalyticsEvent
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
import com.tangem.tap.*
|
import com.tangem.tap.*
|
||||||
import com.tangem.tap.common.analytics.events.Basic
|
import com.tangem.tap.common.analytics.events.Basic
|
||||||
|
|
@ -18,8 +20,6 @@ import com.tangem.tap.common.extensions.eraseContext
|
||||||
import com.tangem.tap.common.extensions.onUserWalletSelected
|
import com.tangem.tap.common.extensions.onUserWalletSelected
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
||||||
import com.tangem.tap.domain.scanCard.ScanCardProcessor
|
import com.tangem.tap.domain.scanCard.ScanCardProcessor
|
||||||
import com.tangem.tap.features.home.BELARUS_COUNTRY_CODE
|
import com.tangem.tap.features.home.BELARUS_COUNTRY_CODE
|
||||||
|
|
|
||||||
|
|
@ -4,23 +4,19 @@ import com.tangem.common.doOnFailure
|
||||||
import com.tangem.common.doOnSuccess
|
import com.tangem.common.doOnSuccess
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.util.cardTypesResolver
|
import com.tangem.domain.common.util.cardTypesResolver
|
||||||
import com.tangem.domain.common.util.twinsIsTwinned
|
import com.tangem.domain.common.util.twinsIsTwinned
|
||||||
import com.tangem.domain.models.scan.ProductType
|
import com.tangem.domain.models.scan.ProductType
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
|
import com.tangem.tap.*
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.extensions.onUserWalletSelected
|
import com.tangem.tap.common.extensions.onUserWalletSelected
|
||||||
import com.tangem.tap.common.extensions.removeContext
|
import com.tangem.tap.common.extensions.removeContext
|
||||||
import com.tangem.tap.common.extensions.setContext
|
import com.tangem.tap.common.extensions.setContext
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
||||||
import com.tangem.tap.features.saveWallet.redux.SaveWalletAction
|
import com.tangem.tap.features.saveWallet.redux.SaveWalletAction
|
||||||
import com.tangem.tap.preferencesStorage
|
|
||||||
import com.tangem.tap.scope
|
|
||||||
import com.tangem.tap.store
|
|
||||||
import com.tangem.tap.tangemSdkManager
|
|
||||||
import com.tangem.tap.userWalletsListManager
|
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@ import androidx.transition.TransitionManager
|
||||||
import coil.load
|
import coil.load
|
||||||
import com.tangem.blockchain.common.Blockchain
|
import com.tangem.blockchain.common.Blockchain
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.ShareElement
|
||||||
import com.tangem.tap.common.analytics.events.Onboarding
|
import com.tangem.tap.common.analytics.events.Onboarding
|
||||||
import com.tangem.tap.common.extensions.getDrawableCompat
|
import com.tangem.tap.common.extensions.getDrawableCompat
|
||||||
import com.tangem.tap.common.extensions.stripZeroPlainString
|
import com.tangem.tap.common.extensions.stripZeroPlainString
|
||||||
import com.tangem.tap.common.redux.navigation.ShareElement
|
|
||||||
import com.tangem.tap.common.toggleWidget.RefreshBalanceWidget
|
import com.tangem.tap.common.toggleWidget.RefreshBalanceWidget
|
||||||
import com.tangem.tap.common.transitions.InternalNoteLayoutTransition
|
import com.tangem.tap.common.transitions.InternalNoteLayoutTransition
|
||||||
import com.tangem.tap.features.addBackPressHandler
|
import com.tangem.tap.features.addBackPressHandler
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,16 @@ package com.tangem.tap.features.onboarding.products.note.redux
|
||||||
import com.tangem.common.CompletionResult
|
import com.tangem.common.CompletionResult
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.extensions.withMainContext
|
import com.tangem.domain.common.extensions.withMainContext
|
||||||
import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE
|
import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE
|
||||||
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
||||||
import com.tangem.tap.common.analytics.events.Onboarding
|
import com.tangem.tap.common.analytics.events.Onboarding
|
||||||
import com.tangem.tap.common.extensions.dispatchDebugErrorNotification
|
import com.tangem.tap.common.extensions.*
|
||||||
import com.tangem.tap.common.extensions.dispatchDialogShow
|
|
||||||
import com.tangem.tap.common.extensions.dispatchErrorNotification
|
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
|
||||||
import com.tangem.tap.common.extensions.dispatchOpenUrl
|
|
||||||
import com.tangem.tap.common.extensions.getAddressData
|
|
||||||
import com.tangem.tap.common.extensions.getTopUpUrl
|
|
||||||
import com.tangem.tap.common.postUi
|
import com.tangem.tap.common.postUi
|
||||||
import com.tangem.tap.common.redux.AppDialog
|
import com.tangem.tap.common.redux.AppDialog
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.TapError
|
import com.tangem.tap.domain.TapError
|
||||||
import com.tangem.tap.domain.extensions.makePrimaryWalletManager
|
import com.tangem.tap.domain.extensions.makePrimaryWalletManager
|
||||||
import com.tangem.tap.features.demo.DemoHelper
|
import com.tangem.tap.features.demo.DemoHelper
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ import androidx.core.view.isVisible
|
||||||
import androidx.transition.TransitionManager
|
import androidx.transition.TransitionManager
|
||||||
import coil.load
|
import coil.load
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.ShareElement
|
||||||
import com.tangem.tap.common.analytics.events.Onboarding
|
import com.tangem.tap.common.analytics.events.Onboarding
|
||||||
import com.tangem.tap.common.extensions.getDrawableCompat
|
import com.tangem.tap.common.extensions.getDrawableCompat
|
||||||
import com.tangem.tap.common.redux.navigation.ShareElement
|
|
||||||
import com.tangem.tap.common.transitions.InternalNoteLayoutTransition
|
import com.tangem.tap.common.transitions.InternalNoteLayoutTransition
|
||||||
import com.tangem.tap.features.addBackPressHandler
|
import com.tangem.tap.features.addBackPressHandler
|
||||||
import com.tangem.tap.features.onboarding.products.BaseOnboardingFragment
|
import com.tangem.tap.features.onboarding.products.BaseOnboardingFragment
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import com.tangem.blockchain.extensions.Result
|
||||||
import com.tangem.common.CompletionResult
|
import com.tangem.common.CompletionResult
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.extensions.withMainContext
|
import com.tangem.domain.common.extensions.withMainContext
|
||||||
import com.tangem.domain.common.util.twinsIsTwinned
|
import com.tangem.domain.common.util.twinsIsTwinned
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
|
|
@ -15,8 +17,6 @@ import com.tangem.tap.common.postUi
|
||||||
import com.tangem.tap.common.redux.AppDialog
|
import com.tangem.tap.common.redux.AppDialog
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.TapError
|
import com.tangem.tap.domain.TapError
|
||||||
import com.tangem.tap.domain.extensions.makePrimaryWalletManager
|
import com.tangem.tap.domain.extensions.makePrimaryWalletManager
|
||||||
import com.tangem.tap.domain.model.builders.UserWalletIdBuilder
|
import com.tangem.tap.domain.model.builders.UserWalletIdBuilder
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import com.tangem.Message
|
||||||
import com.tangem.blockchain.common.Blockchain
|
import com.tangem.blockchain.common.Blockchain
|
||||||
import com.tangem.common.extensions.VoidCallback
|
import com.tangem.common.extensions.VoidCallback
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.ShareElement
|
||||||
import com.tangem.core.ui.fragments.setStatusBarColor
|
import com.tangem.core.ui.fragments.setStatusBarColor
|
||||||
import com.tangem.datasource.asset.AssetReader
|
import com.tangem.datasource.asset.AssetReader
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
|
|
@ -25,7 +26,6 @@ import com.tangem.tap.common.extensions.getDrawableCompat
|
||||||
import com.tangem.tap.common.extensions.hide
|
import com.tangem.tap.common.extensions.hide
|
||||||
import com.tangem.tap.common.extensions.show
|
import com.tangem.tap.common.extensions.show
|
||||||
import com.tangem.tap.common.extensions.stripZeroPlainString
|
import com.tangem.tap.common.extensions.stripZeroPlainString
|
||||||
import com.tangem.tap.common.redux.navigation.ShareElement
|
|
||||||
import com.tangem.tap.common.toggleWidget.RefreshBalanceWidget
|
import com.tangem.tap.common.toggleWidget.RefreshBalanceWidget
|
||||||
import com.tangem.tap.common.transitions.InternalNoteLayoutTransition
|
import com.tangem.tap.common.transitions.InternalNoteLayoutTransition
|
||||||
import com.tangem.tap.domain.twins.TwinsCardWidget
|
import com.tangem.tap.domain.twins.TwinsCardWidget
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import com.tangem.common.CompletionResult
|
||||||
import com.tangem.common.core.TangemSdkError
|
import com.tangem.common.core.TangemSdkError
|
||||||
import com.tangem.common.extensions.ifNotNull
|
import com.tangem.common.extensions.ifNotNull
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.BlockchainNetwork
|
import com.tangem.domain.common.BlockchainNetwork
|
||||||
import com.tangem.domain.common.extensions.withMainContext
|
import com.tangem.domain.common.extensions.withMainContext
|
||||||
import com.tangem.domain.common.util.cardTypesResolver
|
import com.tangem.domain.common.util.cardTypesResolver
|
||||||
|
|
@ -21,8 +23,6 @@ import com.tangem.tap.common.extensions.dispatchDialogShow
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.tasks.product.CreateProductWalletTaskResponse
|
import com.tangem.tap.domain.tasks.product.CreateProductWalletTaskResponse
|
||||||
import com.tangem.tap.features.demo.DemoHelper
|
import com.tangem.tap.features.demo.DemoHelper
|
||||||
import com.tangem.tap.features.home.redux.HomeAction
|
import com.tangem.tap.features.home.redux.HomeAction
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import com.tangem.common.doOnSuccess
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
import com.tangem.common.flatMap
|
import com.tangem.common.flatMap
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.wallets.legacy.UserWalletsListManager
|
import com.tangem.domain.wallets.legacy.UserWalletsListManager
|
||||||
import com.tangem.tap.*
|
import com.tangem.tap.*
|
||||||
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
||||||
|
|
@ -16,8 +18,6 @@ import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.extensions.dispatchWithMain
|
import com.tangem.tap.common.extensions.dispatchWithMain
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
||||||
import com.tangem.tap.domain.userWalletList.di.provideBiometricImplementation
|
import com.tangem.tap.domain.userWalletList.di.provideBiometricImplementation
|
||||||
import com.tangem.tap.domain.userWalletList.isLockable
|
import com.tangem.tap.domain.userWalletList.isLockable
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.tangem.blockchain.blockchains.polkadot.ExistentialDepositProvider
|
||||||
import com.tangem.blockchain.blockchains.stellar.StellarTransactionExtras
|
import com.tangem.blockchain.blockchains.stellar.StellarTransactionExtras
|
||||||
import com.tangem.blockchain.blockchains.ton.TonTransactionExtras
|
import com.tangem.blockchain.blockchains.ton.TonTransactionExtras
|
||||||
import com.tangem.blockchain.blockchains.xrp.XrpTransactionBuilder.XrpTransactionExtras
|
import com.tangem.blockchain.blockchains.xrp.XrpTransactionBuilder.XrpTransactionExtras
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.blockchain.common.*
|
import com.tangem.blockchain.common.*
|
||||||
import com.tangem.blockchain.extensions.SimpleResult
|
import com.tangem.blockchain.extensions.SimpleResult
|
||||||
import com.tangem.common.core.TangemSdkError
|
import com.tangem.common.core.TangemSdkError
|
||||||
|
|
@ -26,7 +27,6 @@ import com.tangem.tap.common.extensions.*
|
||||||
import com.tangem.tap.common.redux.AppDialog
|
import com.tangem.tap.common.redux.AppDialog
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.TangemSigner
|
import com.tangem.tap.domain.TangemSigner
|
||||||
import com.tangem.tap.domain.TapError
|
import com.tangem.tap.domain.TapError
|
||||||
import com.tangem.tap.domain.configurable.warningMessage.WarningMessage
|
import com.tangem.tap.domain.configurable.warningMessage.WarningMessage
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import by.kirich1409.viewbindingdelegate.viewBinding
|
||||||
import com.google.android.material.textfield.TextInputEditText
|
import com.google.android.material.textfield.TextInputEditText
|
||||||
import com.tangem.Message
|
import com.tangem.Message
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.sdk.extensions.hideSoftKeyboard
|
import com.tangem.sdk.extensions.hideSoftKeyboard
|
||||||
import com.tangem.tap.common.KeyboardObserver
|
import com.tangem.tap.common.KeyboardObserver
|
||||||
import com.tangem.tap.common.analytics.events.Token
|
import com.tangem.tap.common.analytics.events.Token
|
||||||
|
|
@ -25,7 +26,6 @@ import com.tangem.tap.common.extensions.getFromClipboard
|
||||||
import com.tangem.tap.common.extensions.setOnImeActionListener
|
import com.tangem.tap.common.extensions.setOnImeActionListener
|
||||||
import com.tangem.tap.common.qrCodeScan.ScanQrCodeActivity
|
import com.tangem.tap.common.qrCodeScan.ScanQrCodeActivity
|
||||||
import com.tangem.tap.common.recyclerView.SpaceItemDecoration
|
import com.tangem.tap.common.recyclerView.SpaceItemDecoration
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.common.snackBar.MaxAmountSnackbar
|
import com.tangem.tap.common.snackBar.MaxAmountSnackbar
|
||||||
import com.tangem.tap.common.text.truncateMiddleWith
|
import com.tangem.tap.common.text.truncateMiddleWith
|
||||||
import com.tangem.tap.common.toggleWidget.IndeterminateProgressButtonWidget
|
import com.tangem.tap.common.toggleWidget.IndeterminateProgressButtonWidget
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package com.tangem.tap.features.shop.redux
|
package com.tangem.tap.features.shop.redux
|
||||||
|
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.common.analytics.events.Shop
|
import com.tangem.tap.common.analytics.events.Shop
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.extensions.dispatchOpenUrl
|
import com.tangem.tap.common.extensions.dispatchOpenUrl
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.scope
|
import com.tangem.tap.scope
|
||||||
import com.tangem.tap.shopService
|
import com.tangem.tap.shopService
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ import android.view.inputmethod.InputMethodManager
|
||||||
import androidx.activity.OnBackPressedCallback
|
import androidx.activity.OnBackPressedCallback
|
||||||
import androidx.fragment.app.viewModels
|
import androidx.fragment.app.viewModels
|
||||||
import by.kirich1409.viewbindingdelegate.viewBinding
|
import by.kirich1409.viewbindingdelegate.viewBinding
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.common.GlobalLayoutStateHandler
|
import com.tangem.tap.common.GlobalLayoutStateHandler
|
||||||
import com.tangem.tap.common.KeyboardObserver
|
import com.tangem.tap.common.KeyboardObserver
|
||||||
import com.tangem.tap.common.extensions.getQuantityString
|
import com.tangem.tap.common.extensions.getQuantityString
|
||||||
import com.tangem.tap.common.extensions.hide
|
import com.tangem.tap.common.extensions.hide
|
||||||
import com.tangem.tap.common.extensions.show
|
import com.tangem.tap.common.extensions.show
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.common.shop.data.ProductType
|
import com.tangem.tap.common.shop.data.ProductType
|
||||||
import com.tangem.tap.features.BaseStoreFragment
|
import com.tangem.tap.features.BaseStoreFragment
|
||||||
import com.tangem.tap.features.shop.presentation.ShopViewModel
|
import com.tangem.tap.features.shop.presentation.ShopViewModel
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ package com.tangem.tap.features.sprinklr.ui
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import com.google.accompanist.web.WebContent
|
import com.google.accompanist.web.WebContent
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.sprinklr.redux.SprinklrState
|
import com.tangem.tap.features.sprinklr.redux.SprinklrState
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package com.tangem.tap.features.tokens.impl.presentation.router
|
package com.tangem.tap.features.tokens.impl.presentation.router
|
||||||
|
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.common.extensions.dispatchDialogShow
|
import com.tangem.tap.common.extensions.dispatchDialogShow
|
||||||
import com.tangem.tap.common.extensions.dispatchNotification
|
import com.tangem.tap.common.extensions.dispatchNotification
|
||||||
import com.tangem.tap.common.redux.AppDialog
|
import com.tangem.tap.common.redux.AppDialog
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.customtoken.api.featuretoggles.CustomTokenFeatureToggles
|
import com.tangem.tap.features.customtoken.api.featuretoggles.CustomTokenFeatureToggles
|
||||||
import com.tangem.tap.features.tokens.legacy.redux.TokensAction
|
import com.tangem.tap.features.tokens.legacy.redux.TokensAction
|
||||||
import com.tangem.tap.features.wallet.redux.models.WalletDialog
|
import com.tangem.tap.features.wallet.redux.models.WalletDialog
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import com.tangem.common.extensions.guard
|
||||||
import com.tangem.common.extensions.toMapKey
|
import com.tangem.common.extensions.toMapKey
|
||||||
import com.tangem.common.flatMap
|
import com.tangem.common.flatMap
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.crypto.hdWallet.DerivationPath
|
import com.tangem.crypto.hdWallet.DerivationPath
|
||||||
import com.tangem.domain.DomainWrapped
|
import com.tangem.domain.DomainWrapped
|
||||||
import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
||||||
|
|
@ -25,8 +27,6 @@ import com.tangem.tap.common.extensions.dispatchDebugErrorNotification
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.TapError
|
import com.tangem.tap.domain.TapError
|
||||||
import com.tangem.tap.domain.model.WalletDataModel
|
import com.tangem.tap.domain.model.WalletDataModel
|
||||||
import com.tangem.tap.features.wallet.models.Currency
|
import com.tangem.tap.features.wallet.models.Currency
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import com.tangem.common.doOnSuccess
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
import com.tangem.common.flatMap
|
import com.tangem.common.flatMap
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.wallets.models.UserWallet
|
import com.tangem.domain.wallets.models.UserWallet
|
||||||
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
||||||
import com.tangem.tap.common.analytics.events.Token.ButtonRemoveToken
|
import com.tangem.tap.common.analytics.events.Token.ButtonRemoveToken
|
||||||
|
|
@ -12,8 +14,6 @@ import com.tangem.tap.common.extensions.dispatchDialogShow
|
||||||
import com.tangem.tap.common.extensions.dispatchErrorNotification
|
import com.tangem.tap.common.extensions.dispatchErrorNotification
|
||||||
import com.tangem.tap.common.extensions.dispatchWithMain
|
import com.tangem.tap.common.extensions.dispatchWithMain
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.TapError
|
import com.tangem.tap.domain.TapError
|
||||||
import com.tangem.tap.domain.scanCard.ScanCardProcessor
|
import com.tangem.tap.domain.scanCard.ScanCardProcessor
|
||||||
import com.tangem.tap.features.wallet.redux.WalletAction
|
import com.tangem.tap.features.wallet.redux.WalletAction
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import com.tangem.blockchain.blockchains.ethereum.EthereumWalletManager
|
||||||
import com.tangem.blockchain.common.AmountType
|
import com.tangem.blockchain.common.AmountType
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.extensions.toCoinId
|
import com.tangem.domain.common.extensions.toCoinId
|
||||||
import com.tangem.domain.common.extensions.toNetworkId
|
import com.tangem.domain.common.extensions.toNetworkId
|
||||||
import com.tangem.feature.swap.presentation.SwapFragment
|
import com.tangem.feature.swap.presentation.SwapFragment
|
||||||
|
|
@ -15,8 +17,6 @@ import com.tangem.tap.common.extensions.dispatchDebugErrorNotification
|
||||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.extensions.dispatchOpenUrl
|
import com.tangem.tap.common.extensions.dispatchOpenUrl
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.tokens.getIconUrl
|
import com.tangem.tap.domain.tokens.getIconUrl
|
||||||
import com.tangem.tap.features.demo.DemoHelper
|
import com.tangem.tap.features.demo.DemoHelper
|
||||||
import com.tangem.tap.features.home.RUSSIA_COUNTRY_CODE
|
import com.tangem.tap.features.home.RUSSIA_COUNTRY_CODE
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import com.tangem.common.CompletionResult
|
||||||
import com.tangem.common.doOnSuccess
|
import com.tangem.common.doOnSuccess
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.datasource.connection.NetworkConnectionManager
|
import com.tangem.datasource.connection.NetworkConnectionManager
|
||||||
import com.tangem.tap.*
|
import com.tangem.tap.*
|
||||||
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
||||||
|
|
@ -18,8 +20,6 @@ import com.tangem.tap.common.analytics.events.Token
|
||||||
import com.tangem.tap.common.extensions.*
|
import com.tangem.tap.common.extensions.*
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.TapError
|
import com.tangem.tap.domain.TapError
|
||||||
import com.tangem.tap.domain.model.WalletDataModel
|
import com.tangem.tap.domain.model.WalletDataModel
|
||||||
import com.tangem.tap.domain.model.WalletStoreModel
|
import com.tangem.tap.domain.model.WalletStoreModel
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import com.badoo.mvicore.modelWatcher
|
||||||
import com.tangem.common.doOnResult
|
import com.tangem.common.doOnResult
|
||||||
import com.tangem.common.extensions.guard
|
import com.tangem.common.extensions.guard
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
||||||
import com.tangem.domain.common.extensions.withMainContext
|
import com.tangem.domain.common.extensions.withMainContext
|
||||||
import com.tangem.feature.swap.api.SwapFeatureToggleManager
|
import com.tangem.feature.swap.api.SwapFeatureToggleManager
|
||||||
|
|
@ -41,7 +42,6 @@ import com.tangem.tap.common.extensions.show
|
||||||
import com.tangem.tap.common.extensions.toQrCode
|
import com.tangem.tap.common.extensions.toQrCode
|
||||||
import com.tangem.tap.common.recyclerView.SpaceItemDecoration
|
import com.tangem.tap.common.recyclerView.SpaceItemDecoration
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.common.utils.SafeStoreSubscriber
|
import com.tangem.tap.common.utils.SafeStoreSubscriber
|
||||||
import com.tangem.tap.domain.model.WalletDataModel
|
import com.tangem.tap.domain.model.WalletDataModel
|
||||||
import com.tangem.tap.features.wallet.models.Currency
|
import com.tangem.tap.features.wallet.models.Currency
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ import coil.load
|
||||||
import coil.size.Scale
|
import coil.size.Scale
|
||||||
import com.badoo.mvicore.modelWatcher
|
import com.badoo.mvicore.modelWatcher
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.core.ui.fragments.setStatusBarColor
|
import com.tangem.core.ui.fragments.setStatusBarColor
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.core.ui.utils.OneTouchClickListener
|
import com.tangem.core.ui.utils.OneTouchClickListener
|
||||||
|
|
@ -37,8 +39,6 @@ import com.tangem.tap.common.extensions.beginDelayedTransition
|
||||||
import com.tangem.tap.common.extensions.show
|
import com.tangem.tap.common.extensions.show
|
||||||
import com.tangem.tap.common.recyclerView.SpaceItemDecoration
|
import com.tangem.tap.common.recyclerView.SpaceItemDecoration
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
import com.tangem.tap.common.redux.global.GlobalAction
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.common.utils.SafeStoreSubscriber
|
import com.tangem.tap.common.utils.SafeStoreSubscriber
|
||||||
import com.tangem.tap.domain.configurable.warningMessage.WarningMessage
|
import com.tangem.tap.domain.configurable.warningMessage.WarningMessage
|
||||||
import com.tangem.tap.domain.statePrinter.printScanResponseState
|
import com.tangem.tap.domain.statePrinter.printScanResponseState
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.tap.common.analytics.events.Token
|
import com.tangem.tap.common.analytics.events.Token
|
||||||
import com.tangem.tap.common.extensions.dispatchDialogHide
|
import com.tangem.tap.common.extensions.dispatchDialogHide
|
||||||
import com.tangem.tap.common.extensions.dispatchOpenUrl
|
import com.tangem.tap.common.extensions.dispatchOpenUrl
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.features.wallet.redux.WalletAction
|
import com.tangem.tap.features.wallet.redux.WalletAction
|
||||||
import com.tangem.tap.features.wallet.redux.models.WalletDialog
|
import com.tangem.tap.features.wallet.redux.models.WalletDialog
|
||||||
import com.tangem.tap.store
|
import com.tangem.tap.store
|
||||||
|
|
@ -17,8 +17,7 @@ import com.tangem.wallet.databinding.DialogRussiansCardholdersWarningBinding
|
||||||
class RussianCardholdersWarningBottomSheetDialog(
|
class RussianCardholdersWarningBottomSheetDialog(
|
||||||
context: Context,
|
context: Context,
|
||||||
private val dialogData: WalletDialog.RussianCardholdersWarningDialog.Data?,
|
private val dialogData: WalletDialog.RussianCardholdersWarningDialog.Data?,
|
||||||
) : BottomSheetDialog
|
) : BottomSheetDialog(context) {
|
||||||
(context) {
|
|
||||||
|
|
||||||
private var binding: DialogRussiansCardholdersWarningBinding? = null
|
private var binding: DialogRussiansCardholdersWarningBinding? = null
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import androidx.core.view.isVisible
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.badoo.mvicore.modelWatcher
|
import com.badoo.mvicore.modelWatcher
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
||||||
import com.tangem.tap.common.analytics.events.MainScreen
|
import com.tangem.tap.common.analytics.events.MainScreen
|
||||||
import com.tangem.tap.common.analytics.events.Portfolio
|
import com.tangem.tap.common.analytics.events.Portfolio
|
||||||
|
|
@ -11,8 +13,6 @@ import com.tangem.tap.common.entities.FiatCurrency
|
||||||
import com.tangem.tap.common.extensions.getQuantityString
|
import com.tangem.tap.common.extensions.getQuantityString
|
||||||
import com.tangem.tap.common.extensions.hide
|
import com.tangem.tap.common.extensions.hide
|
||||||
import com.tangem.tap.common.extensions.show
|
import com.tangem.tap.common.extensions.show
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.model.TotalFiatBalance
|
import com.tangem.tap.domain.model.TotalFiatBalance
|
||||||
import com.tangem.tap.features.tokens.legacy.redux.TokensAction
|
import com.tangem.tap.features.tokens.legacy.redux.TokensAction
|
||||||
import com.tangem.tap.features.wallet.redux.ErrorType
|
import com.tangem.tap.features.wallet.redux.ErrorType
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.tangem.tap.features.walletSelector.redux
|
||||||
import com.tangem.common.*
|
import com.tangem.common.*
|
||||||
import com.tangem.common.core.TangemSdkError
|
import com.tangem.common.core.TangemSdkError
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
import com.tangem.domain.wallets.models.UserWallet
|
import com.tangem.domain.wallets.models.UserWallet
|
||||||
import com.tangem.domain.wallets.models.UserWalletId
|
import com.tangem.domain.wallets.models.UserWalletId
|
||||||
|
|
@ -14,8 +16,6 @@ import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.extensions.dispatchWithMain
|
import com.tangem.tap.common.extensions.dispatchWithMain
|
||||||
import com.tangem.tap.common.extensions.onUserWalletSelected
|
import com.tangem.tap.common.extensions.onUserWalletSelected
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.model.TotalFiatBalance
|
import com.tangem.tap.domain.model.TotalFiatBalance
|
||||||
import com.tangem.tap.domain.model.WalletStoreModel
|
import com.tangem.tap.domain.model.WalletStoreModel
|
||||||
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import com.tangem.common.doOnFailure
|
||||||
import com.tangem.common.doOnResult
|
import com.tangem.common.doOnResult
|
||||||
import com.tangem.common.doOnSuccess
|
import com.tangem.common.doOnSuccess
|
||||||
import com.tangem.common.flatMap
|
import com.tangem.common.flatMap
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
import com.tangem.tap.*
|
import com.tangem.tap.*
|
||||||
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
import com.tangem.tap.common.analytics.events.AnalyticsParam
|
||||||
|
|
@ -13,8 +15,6 @@ import com.tangem.tap.common.extensions.dispatchOnMain
|
||||||
import com.tangem.tap.common.extensions.dispatchWithMain
|
import com.tangem.tap.common.extensions.dispatchWithMain
|
||||||
import com.tangem.tap.common.extensions.onUserWalletSelected
|
import com.tangem.tap.common.extensions.onUserWalletSelected
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
|
||||||
import com.tangem.tap.common.redux.navigation.NavigationAction
|
|
||||||
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
import com.tangem.tap.domain.model.builders.UserWalletBuilder
|
||||||
import com.tangem.tap.domain.scanCard.ScanCardProcessor
|
import com.tangem.tap.domain.scanCard.ScanCardProcessor
|
||||||
import com.tangem.tap.domain.userWalletList.unlockIfLockable
|
import com.tangem.tap.domain.userWalletList.unlockIfLockable
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
package com.tangem.tap.proxy
|
package com.tangem.tap.proxy
|
||||||
|
|
||||||
import com.tangem.TangemSdk
|
import com.tangem.TangemSdk
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
|
import com.tangem.core.navigation.NavigationStateHolder
|
||||||
import com.tangem.domain.models.scan.CardDTO
|
import com.tangem.domain.models.scan.CardDTO
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
import com.tangem.domain.models.scan.ScanResponse
|
||||||
import com.tangem.domain.wallets.legacy.UserWalletsListManager
|
import com.tangem.domain.wallets.legacy.UserWalletsListManager
|
||||||
|
import com.tangem.domain.wallets.legacy.WalletsStateHolder
|
||||||
import com.tangem.tap.common.entities.FiatCurrency
|
import com.tangem.tap.common.entities.FiatCurrency
|
||||||
import com.tangem.tap.common.redux.AppState
|
import com.tangem.tap.common.redux.AppState
|
||||||
import com.tangem.tap.domain.TangemSdkManager
|
import com.tangem.tap.domain.TangemSdkManager
|
||||||
|
|
@ -14,10 +17,12 @@ import org.rekotlin.Store
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds objects from old modules, that missing in DI graph
|
* Holds objects from old modules, that missing in DI graph.
|
||||||
* Object sets manually to use in new modules and [AppStateHolder] proxies its to DI
|
* Object sets manually to use in new modules and [AppStateHolder] proxies its to DI.
|
||||||
*/
|
*/
|
||||||
class AppStateHolder @Inject constructor() {
|
class AppStateHolder @Inject constructor() : WalletsStateHolder, NavigationStateHolder {
|
||||||
|
|
||||||
|
override var userWalletsListManager: UserWalletsListManager? = null
|
||||||
|
|
||||||
@Deprecated("Use scan response from selected user wallet")
|
@Deprecated("Use scan response from selected user wallet")
|
||||||
var scanResponse: ScanResponse? = null
|
var scanResponse: ScanResponse? = null
|
||||||
|
|
@ -27,10 +32,13 @@ class AppStateHolder @Inject constructor() {
|
||||||
var tangemSdkManager: TangemSdkManager? = null
|
var tangemSdkManager: TangemSdkManager? = null
|
||||||
var tangemSdk: TangemSdk? = null
|
var tangemSdk: TangemSdk? = null
|
||||||
var walletStoresManager: WalletStoresManager? = null
|
var walletStoresManager: WalletStoresManager? = null
|
||||||
var userWalletsListManager: UserWalletsListManager? = null
|
|
||||||
var appFiatCurrency: FiatCurrency = FiatCurrency.Default
|
var appFiatCurrency: FiatCurrency = FiatCurrency.Default
|
||||||
|
|
||||||
fun getActualCard(): CardDTO? {
|
fun getActualCard(): CardDTO? {
|
||||||
return scanResponse?.card
|
return scanResponse?.card
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun navigate(action: NavigationAction) {
|
||||||
|
mainStore?.dispatch(action)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
10
common/src/main/java/com/tangem/common/Provider.kt
Normal file
10
common/src/main/java/com/tangem/common/Provider.kt
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.tangem.common
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provider for lazy initialization
|
||||||
|
*
|
||||||
|
* @param action initialization action
|
||||||
|
*
|
||||||
|
[REDACTED_AUTHOR]
|
||||||
|
*/
|
||||||
|
class Provider<T>(action: () -> T) : () -> T by action
|
||||||
1
core/navigation/.gitignore
vendored
Normal file
1
core/navigation/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
/build
|
||||||
14
core/navigation/build.gradle.kts
Normal file
14
core/navigation/build.gradle.kts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
plugins {
|
||||||
|
alias(deps.plugins.android.library)
|
||||||
|
alias(deps.plugins.kotlin.android)
|
||||||
|
id("configuration")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "com.tangem.core.navigation"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(deps.material)
|
||||||
|
implementation(deps.reKotlin)
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.tangem.tap.common.redux.navigation
|
package com.tangem.core.navigation
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.transition.TransitionSet
|
import androidx.transition.TransitionSet
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.tangem.tap.common.redux.navigation
|
package com.tangem.core.navigation
|
||||||
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
|
@ -7,6 +7,7 @@ import org.rekotlin.Action
|
||||||
import java.lang.ref.WeakReference
|
import java.lang.ref.WeakReference
|
||||||
|
|
||||||
sealed class NavigationAction : Action {
|
sealed class NavigationAction : Action {
|
||||||
|
|
||||||
data class NavigateTo(
|
data class NavigateTo(
|
||||||
val screen: AppScreen,
|
val screen: AppScreen,
|
||||||
val fragmentShareTransition: FragmentShareTransition? = null,
|
val fragmentShareTransition: FragmentShareTransition? = null,
|
||||||
|
|
@ -14,10 +15,7 @@ sealed class NavigationAction : Action {
|
||||||
val bundle: Bundle? = null,
|
val bundle: Bundle? = null,
|
||||||
) : NavigationAction()
|
) : NavigationAction()
|
||||||
|
|
||||||
data class PopBackTo(
|
data class PopBackTo(val screen: AppScreen? = null, val inclusive: Boolean = false) : NavigationAction()
|
||||||
val screen: AppScreen? = null,
|
|
||||||
val inclusive: Boolean = false,
|
|
||||||
) : NavigationAction()
|
|
||||||
|
|
||||||
data class OpenUrl(val url: String) : NavigationAction()
|
data class OpenUrl(val url: String) : NavigationAction()
|
||||||
|
|
||||||
|
|
@ -28,5 +26,6 @@ sealed class NavigationAction : Action {
|
||||||
data class Share(val data: String) : NavigationAction()
|
data class Share(val data: String) : NavigationAction()
|
||||||
|
|
||||||
data class ActivityCreated(val activity: WeakReference<AppCompatActivity>) : NavigationAction()
|
data class ActivityCreated(val activity: WeakReference<AppCompatActivity>) : NavigationAction()
|
||||||
|
|
||||||
data class ActivityDestroyed(val activity: WeakReference<AppCompatActivity>) : NavigationAction()
|
data class ActivityDestroyed(val activity: WeakReference<AppCompatActivity>) : NavigationAction()
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.tangem.tap.common.redux.navigation
|
package com.tangem.core.navigation
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import org.rekotlin.StateType
|
import org.rekotlin.StateType
|
||||||
|
|
@ -9,17 +9,25 @@ data class NavigationState(
|
||||||
val activity: WeakReference<AppCompatActivity>? = null,
|
val activity: WeakReference<AppCompatActivity>? = null,
|
||||||
) : StateType
|
) : StateType
|
||||||
|
|
||||||
enum class AppScreen(
|
enum class AppScreen(val isDialogFragment: Boolean = false) {
|
||||||
val isDialogFragment: Boolean = false,
|
|
||||||
) {
|
|
||||||
Home,
|
Home,
|
||||||
Shop,
|
Shop,
|
||||||
Disclaimer,
|
Disclaimer,
|
||||||
OnboardingNote, OnboardingWallet, OnboardingTwins, OnboardingOther,
|
OnboardingNote,
|
||||||
Wallet, WalletDetails,
|
OnboardingWallet,
|
||||||
|
OnboardingTwins,
|
||||||
|
OnboardingOther,
|
||||||
|
Wallet,
|
||||||
|
WalletDetails,
|
||||||
Send,
|
Send,
|
||||||
Details, DetailsSecurity, CardSettings, AppSettings, ResetToFactory, AccessCodeRecovery,
|
Details,
|
||||||
AddTokens, AddCustomToken,
|
DetailsSecurity,
|
||||||
|
CardSettings,
|
||||||
|
AppSettings,
|
||||||
|
ResetToFactory,
|
||||||
|
AccessCodeRecovery,
|
||||||
|
AddTokens,
|
||||||
|
AddCustomToken,
|
||||||
WalletConnectSessions,
|
WalletConnectSessions,
|
||||||
QrScan,
|
QrScan,
|
||||||
ReferralProgram,
|
ReferralProgram,
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.tangem.core.navigation
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigation state holder
|
||||||
|
*
|
||||||
|
[REDACTED_AUTHOR]
|
||||||
|
*/
|
||||||
|
interface NavigationStateHolder {
|
||||||
|
|
||||||
|
/** Navigate by [action] */
|
||||||
|
fun navigate(action: NavigationAction)
|
||||||
|
}
|
||||||
|
|
@ -29,7 +29,6 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
|
||||||
"bitcoin-cash/test" -> Blockchain.BitcoinCashTestnet
|
"bitcoin-cash/test" -> Blockchain.BitcoinCashTestnet
|
||||||
"cardano" -> Blockchain.CardanoShelley
|
"cardano" -> Blockchain.CardanoShelley
|
||||||
"dogecoin" -> Blockchain.Dogecoin
|
"dogecoin" -> Blockchain.Dogecoin
|
||||||
"ducatus" -> Blockchain.Ducatus
|
|
||||||
"litecoin" -> Blockchain.Litecoin
|
"litecoin" -> Blockchain.Litecoin
|
||||||
"rootstock" -> Blockchain.RSK
|
"rootstock" -> Blockchain.RSK
|
||||||
"stellar" -> Blockchain.Stellar
|
"stellar" -> Blockchain.Stellar
|
||||||
|
|
@ -87,7 +86,6 @@ fun Blockchain.toNetworkId(): String {
|
||||||
Blockchain.Cardano -> "cardano"
|
Blockchain.Cardano -> "cardano"
|
||||||
Blockchain.CardanoShelley -> "cardano"
|
Blockchain.CardanoShelley -> "cardano"
|
||||||
Blockchain.Dogecoin -> "dogecoin"
|
Blockchain.Dogecoin -> "dogecoin"
|
||||||
Blockchain.Ducatus -> "ducatus"
|
|
||||||
Blockchain.Ethereum -> "ethereum"
|
Blockchain.Ethereum -> "ethereum"
|
||||||
Blockchain.EthereumTestnet -> "ethereum/test"
|
Blockchain.EthereumTestnet -> "ethereum/test"
|
||||||
Blockchain.EthereumClassic -> "ethereum-classic"
|
Blockchain.EthereumClassic -> "ethereum-classic"
|
||||||
|
|
@ -152,7 +150,6 @@ fun Blockchain.toCoinId(): String {
|
||||||
Blockchain.Fantom, Blockchain.FantomTestnet -> "fantom"
|
Blockchain.Fantom, Blockchain.FantomTestnet -> "fantom"
|
||||||
Blockchain.Tron, Blockchain.TronTestnet -> "tron"
|
Blockchain.Tron, Blockchain.TronTestnet -> "tron"
|
||||||
Blockchain.Polkadot, Blockchain.PolkadotTestnet -> "polkadot"
|
Blockchain.Polkadot, Blockchain.PolkadotTestnet -> "polkadot"
|
||||||
Blockchain.Ducatus -> "ducatus"
|
|
||||||
Blockchain.Litecoin -> "litecoin"
|
Blockchain.Litecoin -> "litecoin"
|
||||||
Blockchain.RSK -> "rootstock"
|
Blockchain.RSK -> "rootstock"
|
||||||
Blockchain.Tezos -> "tezos"
|
Blockchain.Tezos -> "tezos"
|
||||||
|
|
@ -182,7 +179,4 @@ fun Blockchain.isSupportedInApp(): Boolean {
|
||||||
return !excludedBlockchains.contains(this)
|
return !excludedBlockchains.contains(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val excludedBlockchains = listOf(
|
private val excludedBlockchains = listOf(Blockchain.Unknown)
|
||||||
Blockchain.Unknown,
|
|
||||||
Blockchain.Ducatus,
|
|
||||||
)
|
|
||||||
|
|
@ -304,7 +304,7 @@ data class CardDTO(
|
||||||
object NoBackup : BackupStatus()
|
object NoBackup : BackupStatus()
|
||||||
|
|
||||||
val isActive: Boolean
|
val isActive: Boolean
|
||||||
get() = this is Active || this is CardLinked
|
get() = this is Active
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
internal fun fromSdkStatus(sdkStatus: Card.BackupStatus?): BackupStatus? {
|
internal fun fromSdkStatus(sdkStatus: Card.BackupStatus?): BackupStatus? {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ dependencies {
|
||||||
|
|
||||||
// region Domain modules
|
// region Domain modules
|
||||||
implementation(project(":domain:legacy"))
|
implementation(project(":domain:legacy"))
|
||||||
|
implementation(project(":domain:models"))
|
||||||
implementation(project(":domain:wallets:models"))
|
implementation(project(":domain:wallets:models"))
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
package com.tangem.domain.wallets.legacy
|
||||||
|
|
||||||
|
interface WalletsStateHolder {
|
||||||
|
|
||||||
|
val userWalletsListManager: UserWalletsListManager?
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.tangem.domain.wallets.usecase
|
||||||
|
|
||||||
|
import com.tangem.domain.wallets.legacy.WalletsStateHolder
|
||||||
|
import com.tangem.domain.wallets.models.UserWallet
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use case for getting list of user wallets
|
||||||
|
*
|
||||||
|
* @property walletsStateHolder state holder for getting static initialized 'userWalletsListManager'
|
||||||
|
*
|
||||||
|
[REDACTED_AUTHOR]
|
||||||
|
*/
|
||||||
|
class GetWalletsUseCase(private val walletsStateHolder: WalletsStateHolder) {
|
||||||
|
|
||||||
|
@Throws(IllegalArgumentException::class)
|
||||||
|
operator fun invoke(): Flow<List<UserWallet>> {
|
||||||
|
return requireNotNull(walletsStateHolder.userWalletsListManager).userWallets
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9,6 +9,7 @@ plugins {
|
||||||
dependencies {
|
dependencies {
|
||||||
/** AndroidX */
|
/** AndroidX */
|
||||||
implementation(deps.androidx.activity.compose)
|
implementation(deps.androidx.activity.compose)
|
||||||
|
implementation(deps.material)
|
||||||
|
|
||||||
/** Compose */
|
/** Compose */
|
||||||
implementation(deps.compose.coil)
|
implementation(deps.compose.coil)
|
||||||
|
|
@ -34,11 +35,16 @@ dependencies {
|
||||||
|
|
||||||
/** Core modules */
|
/** Core modules */
|
||||||
implementation(project(":core:featuretoggles"))
|
implementation(project(":core:featuretoggles"))
|
||||||
|
implementation(project(":core:navigation"))
|
||||||
implementation(project(":core:ui"))
|
implementation(project(":core:ui"))
|
||||||
|
|
||||||
/** Feature Apis */
|
/** Feature Apis */
|
||||||
implementation(project(":features:wallet:api"))
|
implementation(project(":features:wallet:api"))
|
||||||
|
|
||||||
/** Domain modules */
|
/** Domain modules */
|
||||||
|
implementation(project(":common"))
|
||||||
implementation(project(":domain:legacy"))
|
implementation(project(":domain:legacy"))
|
||||||
|
implementation(project(":domain:models"))
|
||||||
|
implementation(project(":domain:wallets"))
|
||||||
|
implementation(project(":domain:wallets:models"))
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.tangem.feature.wallet.di
|
package com.tangem.feature.wallet.di
|
||||||
|
|
||||||
|
import com.tangem.core.navigation.NavigationStateHolder
|
||||||
import com.tangem.feature.wallet.presentation.router.DefaultWalletRouter
|
import com.tangem.feature.wallet.presentation.router.DefaultWalletRouter
|
||||||
import com.tangem.features.wallet.navigation.WalletRouter
|
import com.tangem.features.wallet.navigation.WalletRouter
|
||||||
import dagger.Module
|
import dagger.Module
|
||||||
|
|
@ -14,5 +15,7 @@ internal object WalletRouterModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@ActivityScoped
|
@ActivityScoped
|
||||||
fun provideWalletRouter(): WalletRouter = DefaultWalletRouter()
|
fun provideWalletRouter(navigationStateHolder: NavigationStateHolder): WalletRouter {
|
||||||
|
return DefaultWalletRouter(navigationStateHolder = navigationStateHolder)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package com.tangem.feature.wallet.presentation
|
package com.tangem.feature.wallet.presentation
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.transition.TransitionInflater
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.compose.ui.platform.ComposeView
|
import androidx.compose.ui.platform.ComposeView
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.transition.TransitionInflater
|
||||||
import com.tangem.core.ui.components.SystemBarsEffect
|
import com.tangem.core.ui.components.SystemBarsEffect
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.feature.wallet.impl.R
|
import com.tangem.feature.wallet.impl.R
|
||||||
|
|
@ -47,7 +47,7 @@ internal class WalletFragment : Fragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
isTransitionGroup = true
|
isTransitionGroup = true
|
||||||
_walletRouter.Initialize()
|
_walletRouter.Initialize(fragmentManager = requireActivity().supportFragmentManager)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ internal object WalletPreviewData {
|
||||||
name = "Polygon",
|
name = "Polygon",
|
||||||
)
|
)
|
||||||
|
|
||||||
val loadingTokenItemState = TokenItemState.Loading(id = UUID.randomUUID().toString())
|
val loadingTokenItemState = TokenItemState.Loading
|
||||||
|
|
||||||
private const val networksSize = 10
|
private const val networksSize = 10
|
||||||
private const val tokensSize = 3
|
private const val tokensSize = 3
|
||||||
|
|
|
||||||
|
|
@ -7,20 +7,12 @@ import androidx.compose.runtime.Immutable
|
||||||
@Immutable
|
@Immutable
|
||||||
internal sealed interface TokenItemState {
|
internal sealed interface TokenItemState {
|
||||||
|
|
||||||
/** Token id */
|
/** Loading token state */
|
||||||
val id: String
|
object Loading : TokenItemState
|
||||||
|
|
||||||
/**
|
|
||||||
* Loading token state
|
|
||||||
*
|
|
||||||
* @property id token id
|
|
||||||
*/
|
|
||||||
data class Loading(override val id: String) : TokenItemState
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Content token state
|
* Content token state
|
||||||
*
|
*
|
||||||
* @property id token id
|
|
||||||
* @property tokenIconUrl token icon url
|
* @property tokenIconUrl token icon url
|
||||||
* @property tokenIconResId token icon resource id
|
* @property tokenIconResId token icon resource id
|
||||||
* @property networkIconResId network icon resource id, may be null if it is a coin
|
* @property networkIconResId network icon resource id, may be null if it is a coin
|
||||||
|
|
@ -30,7 +22,7 @@ internal sealed interface TokenItemState {
|
||||||
* @property tokenOptions state for token options
|
* @property tokenOptions state for token options
|
||||||
*/
|
*/
|
||||||
data class Content(
|
data class Content(
|
||||||
override val id: String,
|
val id: String,
|
||||||
val tokenIconUrl: String?,
|
val tokenIconUrl: String?,
|
||||||
@DrawableRes val tokenIconResId: Int,
|
@DrawableRes val tokenIconResId: Int,
|
||||||
@DrawableRes val networkIconResId: Int?,
|
@DrawableRes val networkIconResId: Int?,
|
||||||
|
|
@ -43,14 +35,13 @@ internal sealed interface TokenItemState {
|
||||||
/**
|
/**
|
||||||
* Draggable token state
|
* Draggable token state
|
||||||
*
|
*
|
||||||
* @property id token id
|
|
||||||
* @property tokenIconUrl token icon url
|
* @property tokenIconUrl token icon url
|
||||||
* @property tokenIconResId token icon resource id
|
* @property tokenIconResId token icon resource id
|
||||||
* @property networkIconResId network icon resource id, may be null if it is a coin
|
* @property networkIconResId network icon resource id, may be null if it is a coin
|
||||||
* @property name token name
|
* @property name token name
|
||||||
*/
|
*/
|
||||||
data class Draggable(
|
data class Draggable(
|
||||||
override val id: String,
|
val id: String,
|
||||||
val tokenIconUrl: String?,
|
val tokenIconUrl: String?,
|
||||||
@DrawableRes val tokenIconResId: Int,
|
@DrawableRes val tokenIconResId: Int,
|
||||||
@DrawableRes val networkIconResId: Int?,
|
@DrawableRes val networkIconResId: Int?,
|
||||||
|
|
@ -68,7 +59,7 @@ internal sealed interface TokenItemState {
|
||||||
* @property name token name
|
* @property name token name
|
||||||
*/
|
*/
|
||||||
data class Unreachable(
|
data class Unreachable(
|
||||||
override val id: String,
|
val id: String,
|
||||||
val tokenIconUrl: String?,
|
val tokenIconUrl: String?,
|
||||||
@DrawableRes val tokenIconResId: Int,
|
@DrawableRes val tokenIconResId: Int,
|
||||||
@DrawableRes val networkIconResId: Int?,
|
@DrawableRes val networkIconResId: Int?,
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,15 @@ import androidx.compose.foundation.layout.systemBarsPadding
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.navigation.NavHostController
|
import androidx.navigation.NavHostController
|
||||||
import androidx.navigation.compose.NavHost
|
import androidx.navigation.compose.NavHost
|
||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import androidx.navigation.compose.rememberNavController
|
import androidx.navigation.compose.rememberNavController
|
||||||
|
import com.tangem.core.navigation.AppScreen
|
||||||
|
import com.tangem.core.navigation.NavigationAction
|
||||||
|
import com.tangem.core.navigation.NavigationStateHolder
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.feature.wallet.presentation.WalletFragment
|
import com.tangem.feature.wallet.presentation.WalletFragment
|
||||||
import com.tangem.feature.wallet.presentation.organizetokens.OrganizeTokensScreen
|
import com.tangem.feature.wallet.presentation.organizetokens.OrganizeTokensScreen
|
||||||
|
|
@ -19,14 +23,17 @@ import com.tangem.feature.wallet.presentation.wallet.viewmodels.WalletViewModel
|
||||||
import kotlin.properties.Delegates
|
import kotlin.properties.Delegates
|
||||||
|
|
||||||
/** Default implementation of wallet feature router */
|
/** Default implementation of wallet feature router */
|
||||||
internal class DefaultWalletRouter : InnerWalletRouter {
|
internal class DefaultWalletRouter(private val navigationStateHolder: NavigationStateHolder) : InnerWalletRouter {
|
||||||
|
|
||||||
private var navController: NavHostController by Delegates.notNull()
|
private var navController: NavHostController by Delegates.notNull()
|
||||||
|
private var fragmentManager: FragmentManager by Delegates.notNull()
|
||||||
|
|
||||||
override fun getEntryFragment(): Fragment = WalletFragment.create()
|
override fun getEntryFragment(): Fragment = WalletFragment.create()
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun Initialize() {
|
override fun Initialize(fragmentManager: FragmentManager) {
|
||||||
|
this.fragmentManager = fragmentManager
|
||||||
|
|
||||||
TangemTheme {
|
TangemTheme {
|
||||||
NavHost(
|
NavHost(
|
||||||
navController = rememberNavController().apply { navController = this },
|
navController = rememberNavController().apply { navController = this },
|
||||||
|
|
@ -53,10 +60,28 @@ internal class DefaultWalletRouter : InnerWalletRouter {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popBackStack() {
|
override fun popBackStack() {
|
||||||
navController.popBackStack()
|
/*
|
||||||
|
* It's hack that avoid issue with closing the wallet screen.
|
||||||
|
* We are using NavGraph only inside feature so first backstack's element is entry of NavGraph and
|
||||||
|
* next element is wallet screen entry.
|
||||||
|
* If backstack contains only NavGraph entry and wallet screen entry then we close the wallet fragment.
|
||||||
|
*/
|
||||||
|
if (navController.backQueue.size == BACKSTACK_ENTRY_COUNT_TO_CLOSE_WALLET_SCREEN) {
|
||||||
|
fragmentManager.popBackStack()
|
||||||
|
} else {
|
||||||
|
navController.popBackStack()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun openOrganizeTokensScreen() {
|
override fun openOrganizeTokensScreen() {
|
||||||
navController.navigate(WalletScreens.ORGANIZE_TOKENS.name)
|
navController.navigate(WalletScreens.ORGANIZE_TOKENS.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun openDetailsScreen() {
|
||||||
|
navigationStateHolder.navigate(NavigationAction.NavigateTo(AppScreen.Details))
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val BACKSTACK_ENTRY_COUNT_TO_CLOSE_WALLET_SCREEN = 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ package com.tangem.feature.wallet.presentation.router
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.Stable
|
import androidx.compose.runtime.Stable
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
import com.tangem.features.wallet.navigation.WalletRouter
|
import com.tangem.features.wallet.navigation.WalletRouter
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -15,14 +16,21 @@ import com.tangem.features.wallet.navigation.WalletRouter
|
||||||
@Stable
|
@Stable
|
||||||
internal interface InnerWalletRouter : WalletRouter {
|
internal interface InnerWalletRouter : WalletRouter {
|
||||||
|
|
||||||
/** Initialize router */
|
/**
|
||||||
|
* Initialize router
|
||||||
|
*
|
||||||
|
* @param fragmentManager fragment manager
|
||||||
|
*/
|
||||||
@Suppress("TopLevelComposableFunctions")
|
@Suppress("TopLevelComposableFunctions")
|
||||||
@Composable
|
@Composable
|
||||||
fun Initialize()
|
fun Initialize(fragmentManager: FragmentManager)
|
||||||
|
|
||||||
/** Pop back stack */
|
/** Pop back stack */
|
||||||
fun popBackStack()
|
fun popBackStack()
|
||||||
|
|
||||||
/** Open organize tokens screen */
|
/** Open organize tokens screen */
|
||||||
fun openOrganizeTokensScreen()
|
fun openOrganizeTokensScreen()
|
||||||
|
|
||||||
|
/** Open details screen */
|
||||||
|
fun openDetailsScreen()
|
||||||
}
|
}
|
||||||
|
|
@ -18,7 +18,7 @@ internal sealed interface WalletCardState {
|
||||||
|
|
||||||
/** Wallet image resource id */
|
/** Wallet image resource id */
|
||||||
@get:DrawableRes
|
@get:DrawableRes
|
||||||
val imageResId: Int
|
val imageResId: Int?
|
||||||
|
|
||||||
/** Lambda be invoked when card is clicked */
|
/** Lambda be invoked when card is clicked */
|
||||||
val onClick: (() -> Unit)?
|
val onClick: (() -> Unit)?
|
||||||
|
|
@ -37,7 +37,7 @@ internal sealed interface WalletCardState {
|
||||||
override val id: String,
|
override val id: String,
|
||||||
override val title: String,
|
override val title: String,
|
||||||
override val additionalInfo: String,
|
override val additionalInfo: String,
|
||||||
override val imageResId: Int,
|
override val imageResId: Int?,
|
||||||
override val onClick: (() -> Unit)? = null,
|
override val onClick: (() -> Unit)? = null,
|
||||||
val balance: String,
|
val balance: String,
|
||||||
) : WalletCardState
|
) : WalletCardState
|
||||||
|
|
@ -55,8 +55,8 @@ internal sealed interface WalletCardState {
|
||||||
override val id: String,
|
override val id: String,
|
||||||
override val title: String,
|
override val title: String,
|
||||||
override val additionalInfo: String,
|
override val additionalInfo: String,
|
||||||
override val imageResId: Int,
|
override val imageResId: Int?,
|
||||||
override val onClick: (() -> Unit)?,
|
override val onClick: (() -> Unit)? = null,
|
||||||
) : WalletCardState
|
) : WalletCardState
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -72,7 +72,7 @@ internal sealed interface WalletCardState {
|
||||||
override val id: String,
|
override val id: String,
|
||||||
override val title: String,
|
override val title: String,
|
||||||
override val additionalInfo: String,
|
override val additionalInfo: String,
|
||||||
override val imageResId: Int,
|
override val imageResId: Int?,
|
||||||
override val onClick: (() -> Unit)?,
|
override val onClick: (() -> Unit)?,
|
||||||
) : WalletCardState
|
) : WalletCardState
|
||||||
|
|
||||||
|
|
@ -89,7 +89,7 @@ internal sealed interface WalletCardState {
|
||||||
override val id: String,
|
override val id: String,
|
||||||
override val title: String,
|
override val title: String,
|
||||||
override val additionalInfo: String,
|
override val additionalInfo: String,
|
||||||
override val imageResId: Int,
|
override val imageResId: Int?,
|
||||||
override val onClick: (() -> Unit)?,
|
override val onClick: (() -> Unit)?,
|
||||||
) : WalletCardState
|
) : WalletCardState
|
||||||
}
|
}
|
||||||
|
|
@ -52,4 +52,6 @@ internal sealed interface WalletContentItemState {
|
||||||
*/
|
*/
|
||||||
data class Transaction(val state: TransactionState) : SingleCurrencyItem
|
data class Transaction(val state: TransactionState) : SingleCurrencyItem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object Loading : WalletContentItemState
|
||||||
}
|
}
|
||||||
|
|
@ -25,6 +25,7 @@ import com.tangem.feature.wallet.impl.R
|
||||||
import com.tangem.feature.wallet.presentation.common.WalletPreviewData
|
import com.tangem.feature.wallet.presentation.common.WalletPreviewData
|
||||||
import com.tangem.feature.wallet.presentation.common.component.NetworkGroupItem
|
import com.tangem.feature.wallet.presentation.common.component.NetworkGroupItem
|
||||||
import com.tangem.feature.wallet.presentation.common.component.TokenItem
|
import com.tangem.feature.wallet.presentation.common.component.TokenItem
|
||||||
|
import com.tangem.feature.wallet.presentation.common.state.TokenItemState
|
||||||
import com.tangem.feature.wallet.presentation.wallet.state.WalletContentItemState
|
import com.tangem.feature.wallet.presentation.wallet.state.WalletContentItemState
|
||||||
import com.tangem.feature.wallet.presentation.wallet.state.WalletStateHolder
|
import com.tangem.feature.wallet.presentation.wallet.state.WalletStateHolder
|
||||||
import com.tangem.feature.wallet.presentation.wallet.ui.components.WalletTopBar
|
import com.tangem.feature.wallet.presentation.wallet.ui.components.WalletTopBar
|
||||||
|
|
@ -67,7 +68,6 @@ internal fun WalletScreen(state: WalletStateHolder) {
|
||||||
WalletsList(
|
WalletsList(
|
||||||
config = state.walletsListConfig,
|
config = state.walletsListConfig,
|
||||||
lazyListState = walletsListState,
|
lazyListState = walletsListState,
|
||||||
modifier = Modifier.padding(bottom = TangemTheme.dimens.spacing14),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ internal fun WalletScreen(state: WalletStateHolder) {
|
||||||
item {
|
item {
|
||||||
WalletManageButtons(
|
WalletManageButtons(
|
||||||
buttons = state.buttons,
|
buttons = state.buttons,
|
||||||
modifier = changeableItemModifier.padding(bottom = TangemTheme.dimens.spacing14),
|
modifier = changeableItemModifier.padding(top = TangemTheme.dimens.spacing14),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -86,8 +86,8 @@ internal fun WalletScreen(state: WalletStateHolder) {
|
||||||
Notification(
|
Notification(
|
||||||
state = item.state,
|
state = item.state,
|
||||||
modifier = changeableItemModifier
|
modifier = changeableItemModifier
|
||||||
.padding(horizontal = TangemTheme.dimens.spacing16)
|
.padding(top = TangemTheme.dimens.spacing14)
|
||||||
.padding(bottom = TangemTheme.dimens.spacing14),
|
.padding(horizontal = TangemTheme.dimens.spacing16),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
@ -96,7 +96,9 @@ internal fun WalletScreen(state: WalletStateHolder) {
|
||||||
item {
|
item {
|
||||||
WalletMarketplaceBlock(
|
WalletMarketplaceBlock(
|
||||||
state = state.marketplaceBlockState,
|
state = state.marketplaceBlockState,
|
||||||
modifier = changeableItemModifier.padding(horizontal = TangemTheme.dimens.spacing16),
|
modifier = changeableItemModifier
|
||||||
|
.padding(top = TangemTheme.dimens.spacing14)
|
||||||
|
.padding(horizontal = TangemTheme.dimens.spacing16),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -106,10 +108,11 @@ internal fun WalletScreen(state: WalletStateHolder) {
|
||||||
key = { index, item ->
|
key = { index, item ->
|
||||||
when (item) {
|
when (item) {
|
||||||
is WalletContentItemState.MultiCurrencyItem.NetworkGroupTitle -> item.networkName
|
is WalletContentItemState.MultiCurrencyItem.NetworkGroupTitle -> item.networkName
|
||||||
is WalletContentItemState.MultiCurrencyItem.Token -> item.state.id
|
is WalletContentItemState.MultiCurrencyItem.Token -> index
|
||||||
is WalletContentItemState.SingleCurrencyItem.Title -> index
|
is WalletContentItemState.SingleCurrencyItem.Title -> index
|
||||||
is WalletContentItemState.SingleCurrencyItem.GroupTitle -> item.title
|
is WalletContentItemState.SingleCurrencyItem.GroupTitle -> item.title
|
||||||
is WalletContentItemState.SingleCurrencyItem.Transaction -> index
|
is WalletContentItemState.SingleCurrencyItem.Transaction -> index
|
||||||
|
is WalletContentItemState.Loading -> index
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
itemContent = { index, item ->
|
itemContent = { index, item ->
|
||||||
|
|
@ -155,6 +158,9 @@ private fun ContentItem(item: WalletContentItemState, modifier: Modifier = Modif
|
||||||
is WalletContentItemState.SingleCurrencyItem.Transaction -> {
|
is WalletContentItemState.SingleCurrencyItem.Transaction -> {
|
||||||
Transaction(state = item.state, modifier = modifier)
|
Transaction(state = item.state, modifier = modifier)
|
||||||
}
|
}
|
||||||
|
WalletContentItemState.Loading -> {
|
||||||
|
TokenItem(state = TokenItemState.Loading, modifier = modifier)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,16 +62,18 @@ internal fun WalletCard(state: WalletCardState, modifier: Modifier = Modifier) {
|
||||||
}
|
}
|
||||||
|
|
||||||
val imageWidth = TangemTheme.dimens.size120
|
val imageWidth = TangemTheme.dimens.size120
|
||||||
WalletImage(
|
state.imageResId?.let {
|
||||||
id = state.imageResId,
|
WalletImage(
|
||||||
modifier = Modifier.constrainAs(imageItem) {
|
id = it,
|
||||||
centerVerticallyTo(parent)
|
modifier = Modifier.constrainAs(imageItem) {
|
||||||
top.linkTo(parent.top)
|
centerVerticallyTo(parent)
|
||||||
end.linkTo(parent.end)
|
top.linkTo(parent.top)
|
||||||
height = Dimension.fillToConstraints
|
end.linkTo(parent.end)
|
||||||
width = Dimension.value(imageWidth)
|
height = Dimension.fillToConstraints
|
||||||
},
|
width = Dimension.value(imageWidth)
|
||||||
)
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,8 @@ internal class ScrollOffsetCollector(
|
||||||
private val LazyListItemInfo.halfItemSize get() = size.div(other = 2)
|
private val LazyListItemInfo.halfItemSize get() = size.div(other = 2)
|
||||||
|
|
||||||
override suspend fun emit(value: List<LazyListItemInfo>) {
|
override suspend fun emit(value: List<LazyListItemInfo>) {
|
||||||
val firstItem = requireNotNull(value.firstOrNull()) {
|
val firstItem = value.firstOrNull() ?: return
|
||||||
"At least 1 item should be visible in list"
|
val lastItem = value.lastOrNull() ?: return
|
||||||
}
|
|
||||||
|
|
||||||
val lastItem = requireNotNull(value.lastOrNull()) {
|
|
||||||
"At least 1 item should be visible in list"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (abs(firstItem.offset) > firstItem.halfItemSize) {
|
if (abs(firstItem.offset) > firstItem.halfItemSize) {
|
||||||
callback(firstItem.index + 1)
|
callback(firstItem.index + 1)
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import androidx.lifecycle.ViewModel
|
||||||
import com.tangem.feature.wallet.presentation.common.WalletPreviewData
|
import com.tangem.feature.wallet.presentation.common.WalletPreviewData
|
||||||
import com.tangem.feature.wallet.presentation.router.InnerWalletRouter
|
import com.tangem.feature.wallet.presentation.router.InnerWalletRouter
|
||||||
import com.tangem.feature.wallet.presentation.wallet.state.WalletStateHolder
|
import com.tangem.feature.wallet.presentation.wallet.state.WalletStateHolder
|
||||||
|
import com.tangem.feature.wallet.presentation.wallet.state.WalletTopBarConfig
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import kotlin.properties.Delegates
|
import kotlin.properties.Delegates
|
||||||
|
|
@ -30,8 +31,9 @@ internal class WalletViewModel @Inject constructor() : ViewModel() {
|
||||||
// TODO: [REDACTED_TASK_KEY] Use production data instead of WalletPreviewData
|
// TODO: [REDACTED_TASK_KEY] Use production data instead of WalletPreviewData
|
||||||
private fun getInitialState(): WalletStateHolder = WalletPreviewData.multicurrencyWalletScreenState.copy(
|
private fun getInitialState(): WalletStateHolder = WalletPreviewData.multicurrencyWalletScreenState.copy(
|
||||||
onBackClick = { router.popBackStack() },
|
onBackClick = { router.popBackStack() },
|
||||||
topBarConfig = WalletPreviewData.multicurrencyWalletScreenState.topBarConfig.copy(
|
topBarConfig = WalletTopBarConfig(
|
||||||
onScanCardClick = { router.openOrganizeTokensScreen() },
|
onScanCardClick = { router.openOrganizeTokensScreen() },
|
||||||
|
onMoreClick = { router.openDetailsScreen() },
|
||||||
),
|
),
|
||||||
walletsListConfig = WalletPreviewData.multicurrencyWalletScreenState.walletsListConfig.copy(
|
walletsListConfig = WalletPreviewData.multicurrencyWalletScreenState.walletsListConfig.copy(
|
||||||
onWalletChange = ::selectWallet,
|
onWalletChange = ::selectWallet,
|
||||||
|
|
|
||||||
|
|
@ -80,9 +80,9 @@ okHttp-prettyLogging = "3.1.0"
|
||||||
# endregion Other libraries
|
# endregion Other libraries
|
||||||
|
|
||||||
# region Tangem
|
# region Tangem
|
||||||
tangemBlockchainSdk = "develop-268"
|
tangemBlockchainSdk = "develop-264"
|
||||||
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||||
tangemCardSdk = "develop-266"
|
tangemCardSdk = "develop-273"
|
||||||
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds
|
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds
|
||||||
# endregion Tangem
|
# endregion Tangem
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,10 @@ include(":common")
|
||||||
include(":core:analytics")
|
include(":core:analytics")
|
||||||
include(":core:datasource")
|
include(":core:datasource")
|
||||||
include(":core:featuretoggles")
|
include(":core:featuretoggles")
|
||||||
|
include(":core:navigation")
|
||||||
include(":core:res")
|
include(":core:res")
|
||||||
include(":core:utils")
|
|
||||||
include(":core:ui")
|
include(":core:ui")
|
||||||
|
include(":core:utils")
|
||||||
// endregion Core modules
|
// endregion Core modules
|
||||||
|
|
||||||
// region Libs modules
|
// region Libs modules
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue