forked from thijooree/android
update docs
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
# Accounts
|
||||
|
||||
The accounts screen is typically the default home destination. It shows all active bank accounts and cards grouped by bank and profile.
|
||||
|
||||
---
|
||||
|
||||
## Fragment — `AccountsFragment`
|
||||
|
||||
Hosts a `RecyclerView` driven by `AccountsAdapter`. Observes `HomeViewModel.accounts` (a `LiveData<List<MibAccount>>`). The list is filtered to only include accounts whose profile visibility flag is enabled.
|
||||
|
||||
A **pull-to-refresh** gesture triggers `HomeActivity.autoRefresh()`, which re-fetches all bank dashboards in parallel.
|
||||
|
||||
---
|
||||
|
||||
## List Structure — `AccountsAdapter`
|
||||
|
||||
The adapter renders a mixed list of section headers and account rows.
|
||||
|
||||
### Section Headers
|
||||
|
||||
Accounts are grouped by bank + CIF type (for MIB) or bank name (for BML/Fahipay). Each group starts with a header row showing:
|
||||
- Bank name and logo
|
||||
- For MIB: `cifType` (e.g., `"Individual"`, `"Sole Propr"`) — never hardcoded, always from API
|
||||
- Profile image (circular avatar, if set)
|
||||
|
||||
### Account / Card Rows
|
||||
|
||||
Each row is bound from an `AccountListDisplay` object produced by `AccountListParser.from(account)`. See [Account Parser Architecture](PARSERS.md) for mapping details.
|
||||
|
||||
| Field | Row element |
|
||||
|---|---|
|
||||
| `name` | Account or card name |
|
||||
| `number` | Masked account/card number |
|
||||
| `typeLabel` | Product type chip (e.g., `"Savings"`, `"Visa Platinum"`) |
|
||||
| `balance` | Balance string (hidden as `••••` when hide-amounts is active) |
|
||||
| `isCard` | Switches between account layout and card layout |
|
||||
| `cardBrandIcon` | Visa / Mastercard / Amex logo drawable |
|
||||
| `statusLabel` | Shown as an amber chip if non-null (e.g., `"Inactive"`) |
|
||||
|
||||
### Quick-Transfer Shortcut
|
||||
|
||||
Each account row has a **Send** button. Tapping it opens `TransferFragment` with the source account pre-selected.
|
||||
|
||||
---
|
||||
|
||||
## Account Tap — History
|
||||
|
||||
Tapping any account row navigates to `AccountHistoryFragment` for that account.
|
||||
|
||||
---
|
||||
|
||||
## Hide Amounts
|
||||
|
||||
When the toolbar eye icon is toggled (or `HomeViewModel.hideAmounts` is `true`), all balance strings in the adapter are replaced with `"••••"` without re-fetching data.
|
||||
|
||||
---
|
||||
|
||||
## Empty State
|
||||
|
||||
If no accounts are loaded (either no credentials or all profiles hidden), the screen shows an empty-state illustration with a prompt to add an account.
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
[← Login](03-login.md) **Next →** [Account History](05-account-history.md)
|
||||
Reference in New Issue
Block a user