forked from thijooree/android
update docs
This commit is contained in:
@@ -17,16 +17,22 @@ Architecture overview of the app's entry point, main container, navigation syste
|
||||
|
||||
### Intent Actions
|
||||
|
||||
External intents (from NFC, shortcuts, or notifications) are passed through to `HomeActivity` via the same forwarding intent:
|
||||
External intents (from NFC, shortcuts, or notifications) are forwarded to `HomeActivity` via the same intent (`MainActivity.kt:57-65`):
|
||||
|
||||
| Action | Effect |
|
||||
|---|---|
|
||||
| `OPEN_TRANSFER` | Opens transfer screen |
|
||||
| `OPEN_SCAN_QR` | Opens QR scanner |
|
||||
| `OPEN_PAY_WITH_CARD` | Opens BML card QR payment |
|
||||
| `TAP_TO_PAY` | Opens BML tap-to-pay NFC flow |
|
||||
| Action | Destination | Notes |
|
||||
|---|---|---|
|
||||
| `sh.sar.basedbank.OPEN_TRANSFER` | `R.id.nav_transfer` | Plain transfer screen |
|
||||
| `sh.sar.basedbank.OPEN_SCAN_QR` | `R.id.nav_transfer` + `auto_scan=true` | Opens [QR scanner](25-qr-scanner.md) immediately |
|
||||
| `sh.sar.basedbank.OPEN_PAY_WITH_CARD` | `R.id.nav_pay_with_card` | Opens [Cards](22-cards.md) (`CardsFragment`) |
|
||||
| `sh.sar.basedbank.TAP_TO_PAY` | `R.id.nav_pay_with_card` + `auto_tap_mode=true` | Enters [Tap to Pay](23-tap-to-pay.md) on the default card |
|
||||
|
||||
`BmlTapToPayActivity` is a dedicated NFC entry point registered in the manifest. It immediately re-fires a `TAP_TO_PAY` intent to `MainActivity` and finishes.
|
||||
### Share-to-Scan (`ACTION_SEND`)
|
||||
|
||||
When another app shares an image to the **Scan to Pay** activity-alias declared in `AndroidManifest.xml`, `MainActivity.kt:47-55` decodes the bitmap on the spot using `ZxingCpp` (while it still holds the share URI permission) and forwards the decoded QR text as `share_qr_text` to `HomeActivity`.
|
||||
|
||||
### NFC Entry Point
|
||||
|
||||
`BmlTapToPayActivity` (manifest-registered, NFC payment service redirect) immediately re-fires a `TAP_TO_PAY` intent to `MainActivity` and finishes — see [Tap to Pay](23-tap-to-pay.md).
|
||||
|
||||
---
|
||||
|
||||
@@ -48,6 +54,9 @@ External intents (from NFC, shortcuts, or notifications) are passed through to `
|
||||
|---|---|
|
||||
| Lock icon | Immediately locks the app → `LockActivity` (animated with scale + alpha) |
|
||||
| Eye icon | Toggles `hideAmounts` in `HomeViewModel`; all balance displays redact to `••••` |
|
||||
| Bell icon | Opens `NotificationsSheetFragment` ([Notifications](24-notifications.md)). Shows `ic_bell` when there are unread notifications, `ic_bell_read` otherwise (`HomeActivity.kt:640-684`) |
|
||||
|
||||
In Circular nav mode the toolbar collapses to just the app title — the lock, eye, and bell items are all hidden (`HomeActivity.kt:646-650`).
|
||||
|
||||
### Auto-refresh
|
||||
|
||||
@@ -61,36 +70,46 @@ A persistent banner appears at the top of `HomeActivity` when network connectivi
|
||||
|
||||
## Navigation Modes
|
||||
|
||||
The user can choose between two navigation modes in Settings → Appearance:
|
||||
Three modes are selectable in Settings → Appearance (`NavCustomization.kt:10-12`):
|
||||
|
||||
### Drawer (default)
|
||||
### Drawer (default) — `NAV_MODE_DRAWER`
|
||||
|
||||
A slide-out navigation drawer containing up to 10 configurable nav items. The hamburger icon in the toolbar opens it.
|
||||
A slide-out navigation drawer containing all configurable nav items. The hamburger icon in the toolbar opens it.
|
||||
|
||||
### Bottom Navigation
|
||||
### Bottom Navigation — `NAV_MODE_BOTTOM`
|
||||
|
||||
A bottom bar with 3 configurable slots plus a fixed **Dashboard** tab (always leftmost) and a **More** tab (always rightmost). Tapping **More** opens `NavMoreSheetFragment` — a bottom sheet listing all items not assigned to the 3 visible slots.
|
||||
A bottom bar with **3** configurable slots plus a fixed **Dashboard** tab (always leftmost) and a **More** tab (always rightmost). Tapping **More** opens `NavMoreSheetFragment` — a bottom sheet listing all items not assigned to the visible slots.
|
||||
|
||||
### Circular — `NAV_MODE_CIRCULAR`
|
||||
|
||||
A radial wheel UI with 4 customisable wheel slots + a lock-icon centre — see [Circular Nav](26-circular-nav.md).
|
||||
|
||||
---
|
||||
|
||||
## Navigation Slots
|
||||
|
||||
10 possible navigation destinations can be assigned to slots. The user reorders them via drag-and-drop in Settings → Appearance.
|
||||
`NavCustomization.ALL_SWAPPABLE` enumerates every reorderable destination. Quick actions and bottom-bar slots persist as individual `SharedPreferences` keys (`NavCustomization.kt:52-93`).
|
||||
|
||||
| Destination | Default slot |
|
||||
| Destination | Nav ID |
|
||||
|---|---|
|
||||
| Accounts | 1 |
|
||||
| Transfer | 2 |
|
||||
| Activities | 3 |
|
||||
| Contacts | 4 |
|
||||
| Financing | 5 |
|
||||
| OTP | 6 |
|
||||
| PayMV QR | 7 |
|
||||
| BML QR Pay | 8 |
|
||||
| Transfer History | 9 |
|
||||
| Settings | 10 |
|
||||
| Accounts | `nav_accounts` |
|
||||
| Contacts | `nav_contacts` |
|
||||
| Transfer | `nav_transfer` |
|
||||
| PayMV QR | `nav_pay_mv_qr` |
|
||||
| Activities | `nav_activities` |
|
||||
| Transfer History | `nav_transfer_history` |
|
||||
| Financing | `nav_finances` |
|
||||
| Cards | `nav_pay_with_card` |
|
||||
| OTP | `nav_otp` |
|
||||
| Settings | `nav_settings` |
|
||||
|
||||
Two **Quick Action** slots appear as FAB-style buttons on the dashboard and are independently configurable.
|
||||
Defaults:
|
||||
|
||||
| Slot set | Defaults |
|
||||
|---|---|
|
||||
| Bottom-bar (3 slots) | Accounts, Contacts, Transfer |
|
||||
| Circular wheel (4 slots) | Transfer, Cards, Contacts, Accounts |
|
||||
| Quick actions (2 FAB slots on dashboard) | Transfer, PayMV QR |
|
||||
|
||||
---
|
||||
|
||||
@@ -101,10 +120,11 @@ Autolock fires after a configurable period of user inactivity. Any touch event r
|
||||
| Timeout option |
|
||||
|---|
|
||||
| 30 seconds |
|
||||
| 1 minute |
|
||||
| 1 minute (default) |
|
||||
| 3 minutes |
|
||||
| 5 minutes |
|
||||
| Never |
|
||||
|
||||
There is no "Never" option (`SettingsSecurityFragment.kt:81-86`) — auto-lock cannot be disabled.
|
||||
|
||||
When the timeout expires a 10-second countdown warning dialog appears. If dismissed, the timer resets. If ignored, the app calls `LockActivity` and clears `app.isUnlocked`.
|
||||
|
||||
@@ -112,17 +132,24 @@ When the timeout expires a 10-second countdown warning dialog appears. If dismis
|
||||
|
||||
## Global State — `BasedBankApp`
|
||||
|
||||
`BasedBankApp` holds all in-memory session data. Nothing is stored to disk except encrypted credentials.
|
||||
`BasedBankApp` holds all in-memory session data (`BasedBankApp.kt:27-49`). Nothing is stored to disk except encrypted credentials.
|
||||
|
||||
| Field | Description |
|
||||
|---|---|
|
||||
| `isUnlocked` | Set to `true` after successful lock-screen auth; guards against process-restart bypass |
|
||||
| `mibSessions` | Map of MIB profile ID → active session (cookies + DH key) |
|
||||
| `bmlSessions` | Map of BML profile ID → OAuth token pair |
|
||||
| `fahipaySessions` | Map of Fahipay login ID → authID + session cookie |
|
||||
| `mibLoginFlows` | Active `MibLoginFlow` instances per profile |
|
||||
| `bmlLoginFlows` | Active `BmlLoginFlow` instances per profile |
|
||||
| `mibMutex` | Coroutine mutex — serializes all MIB API calls to prevent session corruption |
|
||||
| `accounts: List<BankAccount>` | Combined view of every visible account across all banks |
|
||||
| `fullName: String` | Account holder name (best available across logins) |
|
||||
| `mibSessions` | Map of MIB loginId → active session (cookies + DH key) |
|
||||
| `mibProfilesMap` | Per-loginId list of MIB CIF profiles |
|
||||
| `mibLoginFlows` | Active `MibLoginFlow` instances per login |
|
||||
| `mibAccounts: List<BankAccount>` | MIB-only slice of `accounts` |
|
||||
| `bmlSessions` | Map of BML profileId → OAuth tokens |
|
||||
| `bmlProfilesMap` | Per-loginId list of `BmlProfile` |
|
||||
| `bmlLoginFlows` | Active `BmlLoginFlow` instances per login (holds web session cookies for activation) |
|
||||
| `bmlAccounts: List<BankAccount>` | BML-only slice |
|
||||
| `fahipaySessions` | Map of Fahipay loginId → authID + session cookie |
|
||||
| `fahipayAccounts: List<BankAccount>` | Fahipay-only slice |
|
||||
| `mibMutex` | Coroutine mutex — serializes all MIB profile-switch + request sequences |
|
||||
|
||||
### Profile Visibility
|
||||
|
||||
|
||||
Reference in New Issue
Block a user