Updated on 2026-08-14

This commit is contained in:
Tangem 2021-03-29 13:27:44 +03:00
parent 136b6e7eb3
commit ad6834fff0
7 changed files with 35 additions and 25 deletions

View file

@ -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'

View file

@ -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 -> {

View file

@ -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" />
</com.google.android.material.card.MaterialCardView>

View file

@ -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"

View file

@ -74,8 +74,8 @@
<ImageView
android:id="@+id/iv_qr_code"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="10dp"
android:adjustViewBounds="true"
@ -83,6 +83,7 @@
app:layout_constraintEnd_toEndOf="@id/guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/chip_group_address_type"
app:layout_constraintBottom_toBottomOf="@id/btn_copy"
tools:src="@drawable/ic_qr_code_show" />
<androidx.constraintlayout.widget.Guideline
@ -132,9 +133,10 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_marginBottom="4dp"
android:layout_marginBottom="24dp"
android:layout_marginTop="22dp"
android:src="@drawable/ic_inactive"
android:text="Copy"
android:text="@string/wallet_address_button_copy"
android:textAlignment="center"
android:textColor="@color/colorSecondary"
app:chipBackgroundColor="@color/blue_pale"
@ -142,7 +144,7 @@
app:iconStartPadding="12dp"
app:iconEndPadding="0dp"
app:chipIconSize="16dp"
app:layout_constraintBottom_toBottomOf="@id/iv_qr_code"
app:layout_constraintTop_toBottomOf="@id/tv_explore"
app:layout_constraintEnd_toStartOf="@id/btn_share"
app:layout_constraintStart_toEndOf="@id/iv_qr_code" />
@ -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" />

View file

@ -86,6 +86,7 @@ this wallet.
<string name="custom_token_decimals_input_title" translatable="false">Decimals</string>
<string name="custom_token_name_input_placeholder" translatable="false">ex. USD Coin</string>
<string name="custom_token_token_symbol_input_placeholder" translatable="false">ex. USDC</string>
<string name="add_token_added" translatable="false">Added</string>
//Details
<string name="details_section_title_blockchain" translatable="false">Blockchain</string>
@ -93,6 +94,12 @@ this wallet.
<string name="add_tokens_subtitle_blockchains" translatable="false">Blockchains</string>
<string name="add_tokens_subtitle_tokens" translatable="false">Ethereum Tokens</string>
<string name="wallet_address_button_copy" translatable="false">Copy</string>
<string name="wallet_address_button_share" translatable="false">Share</string>
<string name="wallet_button_add_tokens" translatable="false">+ Add tokens</string>
</resources>

View file

@ -1,4 +1,4 @@
ext.versions = [
kotlin : '1.4.30',
kotlin : '1.4.31',
build_gradle: '4.1.2',
]