From ad6834fff09acd6ccf139881d32b387d253c10da Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 29 Mar 2021 13:27:44 +0300 Subject: [PATCH] Updated on 2026-08-14 --- app/build.gradle | 15 +++++++-------- .../middlewares/MultiWalletMiddleware.kt | 13 +++++++------ app/src/main/res/layout/fragment_wallet.xml | 2 +- .../main/res/layout/item_popular_token.xml | 2 +- .../main/res/layout/layout_wallet_details.xml | 19 +++++++++++-------- .../main/res/values/strings_untranslated.xml | 7 +++++++ dependencies.gradle | 2 +- 7 files changed, 35 insertions(+), 25 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5d5b80fc3f..5449d123d1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -71,13 +71,12 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'com.google.android.material:material:1.3.0' implementation "androidx.core:core-ktx:1.3.2" - implementation 'com.google.android.play:core:1.9.1' + implementation 'com.google.android.play:core:1.10.0' implementation 'com.google.android.play:core-ktx:1.8.1' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' -// implementation 'com.tangem:blockchain:1.141.0' - implementation 'blockchain-sdk-kotlin:blockchain:tangem-20210322.144347-8' + implementation 'com.tangem:blockchain:1.157.0' implementation 'com.tangem:core:1.101.0' implementation 'com.tangem:sdk:1.101.0' @@ -85,10 +84,10 @@ dependencies { implementation "androidx.browser:browser:1.3.0" //lifecycle - implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.0" - implementation "androidx.lifecycle:lifecycle-common-java8:2.3.0" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0" + implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1" + implementation "androidx.lifecycle:lifecycle-common-java8:2.3.1" + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1" + implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1" implementation "org.rekotlin:rekotlin:1.0.4" @@ -108,7 +107,7 @@ dependencies { implementation 'com.google.firebase:firebase-config-ktx' implementation 'com.google.firebase:firebase-analytics-ktx' - testImplementation 'junit:junit:4.13.1' + testImplementation 'junit:junit:4.13.2' testImplementation "com.google.truth:truth:1.0.1" androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/MultiWalletMiddleware.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/MultiWalletMiddleware.kt index 7625586f61..4f28ce1f3f 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/MultiWalletMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/MultiWalletMiddleware.kt @@ -1,8 +1,9 @@ package com.tangem.tap.features.wallet.redux.middlewares +import com.tangem.blockchain.blockchains.ethereum.EthereumWalletManager import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.Token -import com.tangem.blockchain.common.TokenManager +import com.tangem.blockchain.common.TokenFinder import com.tangem.blockchain.extensions.Result import com.tangem.tap.common.redux.global.GlobalState import com.tangem.tap.common.redux.navigation.AppScreen @@ -53,9 +54,9 @@ class MultiWalletMiddleware { val walletManager = walletState?.getWalletManager(Blockchain.Ethereum.currency) ?: return val alreadyAddedTokens = walletManager.presetTokens - val tokenManager = walletManager as TokenManager + val tokenFinder = walletManager as TokenFinder scope.launch { - val result = tokenManager.findTokens() + val result = tokenFinder.findTokens() withContext(Dispatchers.Main) { when (result) { is Result.Success -> { @@ -75,10 +76,10 @@ class MultiWalletMiddleware { } private fun addToken(token: Token, walletState: WalletState?) { - val tokenManager = - (walletState?.getWalletManager(Blockchain.Ethereum.currency) as? TokenManager) + val walletManager = + (walletState?.getWalletManager(Blockchain.Ethereum.currency) as? EthereumWalletManager) scope.launch { - val result = tokenManager?.addToken(token) + val result = walletManager?.addToken(token) withContext(Dispatchers.Main) { when (result) { is Result.Success -> { diff --git a/app/src/main/res/layout/fragment_wallet.xml b/app/src/main/res/layout/fragment_wallet.xml index 47619d0f8c..04557df535 100644 --- a/app/src/main/res/layout/fragment_wallet.xml +++ b/app/src/main/res/layout/fragment_wallet.xml @@ -160,7 +160,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" - android:text="+ Add tokens" + android:text="@string/wallet_button_add_tokens" android:textSize="14sp" /> diff --git a/app/src/main/res/layout/item_popular_token.xml b/app/src/main/res/layout/item_popular_token.xml index 031069600f..8d22ab57b4 100644 --- a/app/src/main/res/layout/item_popular_token.xml +++ b/app/src/main/res/layout/item_popular_token.xml @@ -85,7 +85,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="24dp" android:src="@drawable/ic_inactive" - android:text="Added" + android:text="@string/add_token_added" android:textAlignment="center" android:textColor="@android:color/white" app:chipBackgroundColor="@color/tapButtonDisabled" diff --git a/app/src/main/res/layout/layout_wallet_details.xml b/app/src/main/res/layout/layout_wallet_details.xml index 8c33b83ce9..d276934193 100644 --- a/app/src/main/res/layout/layout_wallet_details.xml +++ b/app/src/main/res/layout/layout_wallet_details.xml @@ -74,8 +74,8 @@ @@ -153,9 +155,10 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginEnd="16dp" - android:layout_marginBottom="4dp" + android:layout_marginBottom="24dp" + android:layout_marginTop="22dp" android:src="@drawable/ic_inactive" - android:text="Share" + android:text="@string/wallet_address_button_share" app:chipIcon="@drawable/ic_share_chip" app:iconStartPadding="12dp" app:iconEndPadding="0dp" @@ -163,7 +166,7 @@ android:textAlignment="center" android:textColor="@color/colorSecondary" app:chipBackgroundColor="@color/blue_pale" - app:layout_constraintBottom_toBottomOf="@id/iv_qr_code" + app:layout_constraintTop_toBottomOf="@id/tv_explore" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/btn_copy" /> diff --git a/app/src/main/res/values/strings_untranslated.xml b/app/src/main/res/values/strings_untranslated.xml index d7fe68d48a..3e6b22d9c1 100644 --- a/app/src/main/res/values/strings_untranslated.xml +++ b/app/src/main/res/values/strings_untranslated.xml @@ -86,6 +86,7 @@ this wallet. Decimals ex. USD Coin ex. USDC + Added //Details Blockchain @@ -93,6 +94,12 @@ this wallet. Blockchains Ethereum Tokens + Copy + Share + + Add tokens + + + diff --git a/dependencies.gradle b/dependencies.gradle index 6aa50c71a1..2d54129379 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,4 +1,4 @@ ext.versions = [ - kotlin : '1.4.30', + kotlin : '1.4.31', build_gradle: '4.1.2', ]