diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml
index b2533b8565..0f5311120c 100644
--- a/common/src/main/res/values/strings.xml
+++ b/common/src/main/res/values/strings.xml
@@ -13,6 +13,7 @@
Buy Dash
Copied
Staking
+ Spend
Email
e.g. johndoe@mail.com
Error
diff --git a/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutOption.kt b/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutOption.kt
index da422cd865..2c2d5f5597 100644
--- a/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutOption.kt
+++ b/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutOption.kt
@@ -31,11 +31,7 @@ enum class ShortcutOption(
R.drawable.ic_shortcut_secure_now,
R.string.shortcut_secure_now
),
- EXPLORE(
- 1,
- R.drawable.ic_explore,
- R.string.menu_explore_title
- ),
+
RECEIVE(
2,
R.drawable.ic_transaction_received,
@@ -69,7 +65,12 @@ enum class ShortcutOption(
WHERE_TO_SPEND(
8,
R.drawable.ic_where_to_spend,
- R.string.explore_where_to_spend
+ R.string.spend_title
+ ),
+ EXPLORE(
+ 1,
+ R.drawable.ic_explore,
+ R.string.menu_explore_title
),
ATMS(
9,
diff --git a/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutProvider.kt b/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutProvider.kt
index f00500777a..c7eac0833a 100644
--- a/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutProvider.kt
+++ b/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutProvider.kt
@@ -70,21 +70,44 @@ class ShortcutProvider @Inject constructor(
}
.launchIn(scope)
}
+ /* Current Default Shortcuts
+ When they have a zero balance and have not verified their passphrase
+ Backup
+ Receive
+ Buy & Sell
+ Spend
+ When they have a zero balance and have verified their passphrase
+ Receive
+ Send
+ Buy & Sell
+ Spend
+ When they have a balance and have verified their passphrase
+ Receive
+ Send
+ Scan
+ Spend
+ When they have a balance and have not verified their passphrase
+ Backup
+ Receive
+ Send
+ Spend
+ */
// Default logic before the user customizes shortcuts
fun getFilteredShortcuts(
isPassphraseVerified: Boolean = true,
userHasBalance: Boolean = true,
- userHasContacts: Boolean = false
+ userHasContacts: Boolean = false,
+ prioritizeSpend: Boolean = true
): List {
val shortcuts = ShortcutOption.entries.filter { shortcut ->
when (shortcut) {
ShortcutOption.SECURE_NOW -> !isPassphraseVerified
- ShortcutOption.SCAN_QR -> userHasBalance
- ShortcutOption.SEND -> !userHasBalance && isPassphraseVerified
+ ShortcutOption.SCAN_QR -> userHasBalance && isPassphraseVerified
+ ShortcutOption.SEND -> userHasBalance || isPassphraseVerified
ShortcutOption.BUY_SELL -> !userHasBalance
- ShortcutOption.SEND_TO_ADDRESS -> userHasBalance
- ShortcutOption.SEND_TO_CONTACT -> userHasBalance && userHasContacts
+ ShortcutOption.SEND_TO_ADDRESS -> userHasBalance && !prioritizeSpend
+ ShortcutOption.SEND_TO_CONTACT -> userHasBalance && userHasContacts && !prioritizeSpend
else -> true
}
}
diff --git a/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutsViewModel.kt b/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutsViewModel.kt
index dfd035bb37..378ca146d9 100644
--- a/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutsViewModel.kt
+++ b/wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutsViewModel.kt
@@ -163,7 +163,8 @@ class ShortcutsViewModel @Inject constructor(
return shortcutProvider.getFilteredShortcuts(
isPassphraseVerified = isPassphraseVerified,
userHasBalance = userHasBalance,
- userHasContacts = userHasContacts
+ userHasContacts = userHasContacts,
+ prioritizeSpend = true
)
}