Updated on 2026-08-14

This commit is contained in:
Tangem 2021-11-03 13:00:34 +03:00
parent 5cb96145db
commit cbebea5690
4 changed files with 19 additions and 3 deletions

View file

@ -300,9 +300,11 @@ class WalletDetailsFragment : Fragment(R.layout.fragment_wallet_details), StoreS
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
if (store.state.walletState.canBeRemoved(store.state.walletState.getSelectedWalletData())) {
inflater.inflate(R.menu.wallet_details, menu)
}
inflater.inflate(R.menu.wallet_details, menu)
val walletCanBeRemoved = store.state.walletState.canBeRemoved(
store.state.walletState.getSelectedWalletData()
)
menu.getItem(0).isEnabled = walletCanBeRemoved
}
}

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:alpha="@dimen/material_emphasis_medium" android:color="?attr/colorOnSurface"/>
<item android:alpha="@dimen/material_emphasis_disabled" android:color="?attr/colorOnSurface"/>
</selector>

View file

@ -23,6 +23,7 @@
android:layout_height="?attr/actionBarSize"
app:menu="@menu/wallet_details"
app:navigationIcon="@drawable/ic_baseline_arrow_back_24"
android:theme="@style/ThemeOverlay.MyTheme.Toolbar"
app:title=" " />
</com.google.android.material.appbar.AppBarLayout>

View file

@ -20,6 +20,14 @@
<item name="actionMenuTextColor">@android:color/white</item>
</style>
<!-- Toolbar - overrides the menu text color to use a selector that responds to whether it's enabled or not -->
<style name="ThemeOverlay.MyTheme.Toolbar" parent="ThemeOverlay.MaterialComponents.Toolbar.Surface">
<!-- Color used in the icons of menu actions (i.e. non-overflow menu items). This is just convention, this will affect anything that uses ?attr/colorControlNormal) -->
<item name="colorControlNormal">@color/menu_item_color</item>
<!-- Color used in the text of menu actions (i.e. non-overflow menu items) -->
<item name="actionMenuTextColor">@color/menu_item_color</item>
</style>
<!-- EditText -->
<style name="StyledEditText" parent="TextAppearance.MaterialComponents.Body1">
<item name="colorControlNormal">#e34b1c</item>