Updated on 2026-08-14

This commit is contained in:
Tangem 2022-10-20 10:16:40 +05:00
parent a74efa2951
commit 4df6bba522
9 changed files with 13 additions and 9 deletions

View file

@ -30,10 +30,14 @@ import com.tangem.tap.store
import com.tangem.wallet.R
import com.tangem.wallet.databinding.FragmentAddTokensBinding
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.debounce
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import org.rekotlin.StoreSubscriber
class AddTokensFragment : Fragment(R.layout.fragment_add_tokens),
StoreSubscriber<TokensState> {
@ -123,7 +127,7 @@ class AddTokensFragment : Fragment(R.layout.fragment_add_tokens),
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
inflater.inflate(R.menu.popular_tokens, menu)
inflater.inflate(R.menu.menu_popular_tokens, menu)
val addCustomTokenAllowed = store.state.tokensState.allowToAdd
menu.findItem(R.id.menu_navigate_add_custom_token).isVisible = addCustomTokenAllowed

View file

@ -345,7 +345,7 @@ class WalletDetailsFragment : Fragment(R.layout.fragment_wallet_details),
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
inflater.inflate(R.menu.wallet_details, menu)
inflater.inflate(R.menu.menu_wallet_details, menu)
}
private fun TextView.setWarningStatus(mainMessage: Int, error: String? = null) {

View file

@ -139,7 +139,7 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), StoreSubscriber<Walle
if (!state.shouldShowDetails) {
binding.toolbar.menu.removeItem(R.id.details_menu)
} else if (binding.toolbar.menu.findItem(R.id.details_menu) == null) {
binding.toolbar.inflateMenu(R.menu.wallet)
binding.toolbar.inflateMenu(R.menu.menu_wallet)
}
setupNoInternetHandling(state)
@ -219,6 +219,6 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), StoreSubscriber<Walle
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
if (store.state.walletState.shouldShowDetails) inflater.inflate(R.menu.wallet, menu)
if (store.state.walletState.shouldShowDetails) inflater.inflate(R.menu.menu_wallet, menu)
}
}

View file

@ -19,7 +19,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:menu="@menu/popular_tokens"
app:menu="@menu/menu_popular_tokens"
app:navigationIcon="@drawable/ic_baseline_arrow_back_24"
app:title="@string/add_tokens_title" />

View file

@ -21,7 +21,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:menu="@menu/wallet"
app:menu="@menu/menu_wallet"
app:navigationIcon="@drawable/ic_scan_card"
app:navigationIconTint="@color/darkGray6"
app:title="@string/wallet_title"

View file

@ -22,7 +22,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.MyTheme.Toolbar"
app:menu="@menu/wallet_details"
app:menu="@menu/menu_wallet_details"
app:navigationIcon="@drawable/ic_baseline_arrow_back_24"
app:title=" " />