diff --git a/app/src/main/java/sh/sar/basedbank/ui/home/DashboardFragment.kt b/app/src/main/java/sh/sar/basedbank/ui/home/DashboardFragment.kt
index ba2d96d..ac020e3 100644
--- a/app/src/main/java/sh/sar/basedbank/ui/home/DashboardFragment.kt
+++ b/app/src/main/java/sh/sar/basedbank/ui/home/DashboardFragment.kt
@@ -278,26 +278,23 @@ class DashboardFragment : Fragment() {
.groupBy({ it.first }, { it.second })
.mapValues { (_, vs) -> vs.sum() }
+ val blockedMvr = blockedByCurrency["MVR"] ?: 0.0
+ val blockedUsd = blockedByCurrency["USD"] ?: 0.0
val blockedTotal = blockedByCurrency.values.sum()
- if (blockedTotal > 0.0) {
- // Primary line: prefer MVR if present, otherwise the first currency.
- val primaryCcy = if ("MVR" in blockedByCurrency) "MVR" else blockedByCurrency.keys.first()
- val primaryAmt = blockedByCurrency.getValue(primaryCcy)
- binding.tvBlockedTotal.text = if (hide) "$primaryCcy ••••••" else "$primaryCcy %,.2f".format(primaryAmt)
- val secondary = blockedByCurrency.filterKeys { it != primaryCcy }
- if (secondary.isNotEmpty()) {
- binding.tvBlockedSecondary.text = secondary.entries.joinToString(" · ") { (ccy, amt) ->
- if (hide) "$ccy ••••••" else "$ccy %,.2f".format(amt)
- }
- binding.tvBlockedSecondary.visibility = View.VISIBLE
- } else {
- binding.tvBlockedSecondary.visibility = View.GONE
- }
- binding.cardBlocked.visibility = View.VISIBLE
+ if (blockedMvr > 0.0) {
+ binding.tvBlockedMvr.text = if (hide) "MVR ••••••" else "MVR %,.2f".format(blockedMvr)
+ binding.cardBlockedMvr.visibility = View.VISIBLE
} else {
- binding.cardBlocked.visibility = View.GONE
+ binding.cardBlockedMvr.visibility = View.GONE
}
+ if (blockedUsd > 0.0) {
+ binding.tvBlockedUsd.text = if (hide) "USD ••••••" else "USD %,.2f".format(blockedUsd)
+ binding.cardBlockedUsd.visibility = View.VISIBLE
+ } else {
+ binding.cardBlockedUsd.visibility = View.GONE
+ }
+ binding.rowBlocked.visibility = if (blockedTotal > 0.0) View.VISIBLE else View.GONE
// Overdue: MIB finance deals + BML loan details (assumed MVR — matches existing Pending Finances).
val mibOverdue = (viewModel.financing.value ?: emptyList()).sumOf { it.overdueAmount }
@@ -310,8 +307,7 @@ class DashboardFragment : Fragment() {
binding.cardOverdue.visibility = View.GONE
}
- binding.rowAttention.visibility =
- if (blockedTotal > 0.0 || overdueTotal > 0.0) View.VISIBLE else View.GONE
+ binding.rowAttention.visibility = if (overdueTotal > 0.0) View.VISIBLE else View.GONE
}
private fun updatePendingFinances() {
diff --git a/app/src/main/res/layout/fragment_dashboard.xml b/app/src/main/res/layout/fragment_dashboard.xml
index 3fc1b63..1438887 100644
--- a/app/src/main/res/layout/fragment_dashboard.xml
+++ b/app/src/main/res/layout/fragment_dashboard.xml
@@ -176,9 +176,9 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 0c5de6d..878b4d0 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -218,7 +218,8 @@
Cards
Available Balance
%1$s blocked
- Blocked Funds
+ Blocked MVR
+ Blocked USD
Overdue Financing