forked from thijooree/android
prep for reload/raastas part 2
This commit is contained in:
@@ -35,6 +35,8 @@ import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import java.util.UUID
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import sh.sar.basedbank.BasedBankApp
|
||||
@@ -47,11 +49,13 @@ import sh.sar.basedbank.databinding.FragmentTransferBinding
|
||||
import sh.sar.basedbank.databinding.ItemAccountDropdownBinding
|
||||
import sh.sar.basedbank.databinding.ItemPickerRowBinding
|
||||
import sh.sar.basedbank.databinding.ItemPickerSectionHeaderBinding
|
||||
import sh.sar.basedbank.databinding.ItemTransferTypeBinding
|
||||
import sh.sar.basedbank.ui.home.transfer.BmlTransferHandler
|
||||
import sh.sar.basedbank.ui.home.transfer.FahipayTransferHandler
|
||||
import sh.sar.basedbank.ui.home.transfer.MfaisaTransferHandler
|
||||
import sh.sar.basedbank.ui.home.transfer.MibTransferHandler
|
||||
import sh.sar.basedbank.ui.home.transfer.TransferDraft
|
||||
import sh.sar.basedbank.ui.home.transfer.TransferType
|
||||
import sh.sar.basedbank.util.AccountListParser
|
||||
import sh.sar.basedbank.util.CredentialStore
|
||||
import sh.sar.basedbank.util.AccountInputParser
|
||||
@@ -497,6 +501,7 @@ class TransferFragment : Fragment() {
|
||||
}
|
||||
draft.toText.isNotEmpty() -> binding.etTo.setText(draft.toText, false)
|
||||
}
|
||||
if (transferTypePending) showTransferTypePicker()
|
||||
updateTransferButton()
|
||||
}
|
||||
|
||||
@@ -539,6 +544,117 @@ class TransferFragment : Fragment() {
|
||||
binding.tilTo.endIconDrawable = ContextCompat.getDrawable(requireContext(), android.R.drawable.ic_menu_search)
|
||||
}
|
||||
|
||||
// ── Transfer type ─────────────────────────────────────────────────────────
|
||||
|
||||
/** The open "Transfer Type" picker, if any — dismissed when the options go away. */
|
||||
private var transferTypeDialog: AlertDialog? = null
|
||||
|
||||
/**
|
||||
* Offers [types] for [number]. A lone option is applied straight away; with more, the
|
||||
* "Transfer Type" picker pops up with nothing preselected — the user has to pick, and Send
|
||||
* stays disabled until they do. Either way the pick also switches the source to an account
|
||||
* that can pay it (see [applyTransferType]).
|
||||
*/
|
||||
internal fun offerTransferTypes(number: String, types: List<TransferType>) {
|
||||
draft.transferTypes = types
|
||||
draft.transferTypeNumber = number
|
||||
draft.transferType = null
|
||||
types.singleOrNull()?.let { applyTransferType(it); return }
|
||||
updateTransferButton()
|
||||
showTransferTypePicker()
|
||||
}
|
||||
|
||||
/**
|
||||
* Pops up the offered transfer types. Before anything is picked the user must choose or
|
||||
* cancel, and cancelling gives up on the number: the options are dropped and the "To" field
|
||||
* is back for editing. Reopened to change a pick, cancelling just keeps the current one.
|
||||
*/
|
||||
private fun showTransferTypePicker() {
|
||||
val types = draft.transferTypes
|
||||
if (types.isEmpty() || transferTypeDialog?.isShowing == true) return
|
||||
// Up to three tiles a row; fewer options just share the width
|
||||
val grid = androidx.recyclerview.widget.RecyclerView(requireContext()).apply {
|
||||
layoutManager = androidx.recyclerview.widget.GridLayoutManager(context, types.size.coerceIn(1, 3))
|
||||
val pad = (20 * resources.displayMetrics.density).toInt()
|
||||
setPadding(pad, pad / 2, pad, 0)
|
||||
clipToPadding = false
|
||||
overScrollMode = View.OVER_SCROLL_NEVER
|
||||
}
|
||||
grid.adapter = object : androidx.recyclerview.widget.RecyclerView.Adapter<androidx.recyclerview.widget.RecyclerView.ViewHolder>() {
|
||||
override fun getItemCount() = types.size
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) =
|
||||
object : androidx.recyclerview.widget.RecyclerView.ViewHolder(
|
||||
ItemTransferTypeBinding.inflate(layoutInflater, parent, false).root) {}
|
||||
override fun onBindViewHolder(holder: androidx.recyclerview.widget.RecyclerView.ViewHolder, position: Int) {
|
||||
val tile = ItemTransferTypeBinding.bind(holder.itemView)
|
||||
val type = types[position]
|
||||
tile.ivIcon.setImageResource(type.iconRes)
|
||||
val badge = type.badgeRes
|
||||
tile.ivBadge.visibility = if (badge != null) View.VISIBLE else View.GONE
|
||||
badge?.let { tile.ivBadge.setImageResource(it) }
|
||||
tile.tvLabel.text = type.label
|
||||
tile.tvSubtitle.text = type.subtitle
|
||||
tile.root.setOnClickListener {
|
||||
transferTypeDialog?.dismiss()
|
||||
applyTransferType(type)
|
||||
}
|
||||
}
|
||||
}
|
||||
transferTypeDialog = MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(getString(R.string.transfer_type_for, draft.transferTypeNumber))
|
||||
.setView(grid)
|
||||
.setNegativeButton(android.R.string.cancel) { _, _ -> if (transferTypePending) clearRecipient() }
|
||||
.setCancelable(!transferTypePending)
|
||||
.setOnDismissListener { transferTypeDialog = null }
|
||||
.show()
|
||||
}
|
||||
|
||||
/** Forgets the offered types and closes the picker if it's up. */
|
||||
internal fun resetTransferTypes() {
|
||||
draft.transferTypes = emptyList()
|
||||
draft.transferTypeNumber = ""
|
||||
draft.transferType = null
|
||||
fahipayHandler?.clearState()
|
||||
transferTypeDialog?.dismiss()
|
||||
updateTransferButton()
|
||||
}
|
||||
|
||||
/** Options are on offer but the user hasn't picked one yet. */
|
||||
private val transferTypePending: Boolean
|
||||
get() = draft.transferTypes.isNotEmpty() && draft.transferType == null
|
||||
|
||||
/**
|
||||
* Applies a picked transfer type: switches the source to one that can pay it, unless the
|
||||
* selected one already can, then fills the recipient card.
|
||||
*/
|
||||
private fun applyTransferType(type: TransferType) {
|
||||
draft.transferType = type
|
||||
val number = draft.transferTypeNumber
|
||||
val source = selectedAccount
|
||||
if (source == null || !type.worksFrom(source)) {
|
||||
val accounts = viewModel.accounts.value ?: emptyList()
|
||||
val defaultNum = CredentialStore(requireContext()).getDefaultAccountNumber()
|
||||
val pick = when (type) {
|
||||
// The default account when it can do Favara, otherwise leave the user to choose
|
||||
is TransferType.Favara -> accounts.firstOrNull { it.accountNumber == defaultNum && type.worksFrom(it) }
|
||||
is TransferType.Fahipay -> accounts.firstOrNull(type::worksFrom)
|
||||
}
|
||||
if (pick != null) selectSourceAccount(pick)
|
||||
else {
|
||||
clearSourceAccount()
|
||||
Toast.makeText(requireContext(), R.string.transfer_no_from_account, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
when (type) {
|
||||
is TransferType.Favara -> {
|
||||
fahipayHandler?.clearState()
|
||||
showFavaraRecipient(type.info)
|
||||
}
|
||||
is TransferType.Fahipay -> fahipayHandler().applyService(type, number)
|
||||
}
|
||||
updateTransferButton()
|
||||
}
|
||||
|
||||
// ── Sensitive masking helpers ─────────────────────────────────────────────
|
||||
|
||||
private fun maskAmount(formatted: String): String {
|
||||
@@ -568,6 +684,16 @@ class TransferFragment : Fragment() {
|
||||
binding.actvFrom.setText("", false)
|
||||
return@setOnItemClickListener
|
||||
}
|
||||
// A source that can't pay the picked transfer type: drop the pick and its
|
||||
// recipient card, and ask again for the same number. A lone option would only
|
||||
// switch the source straight back, so then the recipient goes altogether.
|
||||
if (draft.transferType?.worksFrom(picked) == false) {
|
||||
if (draft.transferTypes.size > 1) {
|
||||
clearRecipient(keepTransferTypes = true)
|
||||
draft.transferType = null
|
||||
showTransferTypePicker()
|
||||
} else clearRecipient()
|
||||
}
|
||||
selectedAccount = picked
|
||||
updateAmountPrefix(picked)
|
||||
showFromCard(picked)
|
||||
@@ -826,28 +952,18 @@ class TransferFragment : Fragment() {
|
||||
} else false
|
||||
}
|
||||
|
||||
binding.btnClearToInfo.setOnClickListener {
|
||||
bmlHandler().clearQrMerchant()
|
||||
bmlHandler().clearCardMerchant()
|
||||
mfaisaHandler().clearQrMerchant()
|
||||
resolvedAccountNumber = ""
|
||||
resolvedRecipientName = ""
|
||||
resolvedDestCurrency = ""
|
||||
resolvedToOwnAccount = null
|
||||
fahipayHandler().clearState()
|
||||
mfaisaHandler?.clearState()
|
||||
binding.cardToInfo.visibility = View.GONE
|
||||
binding.tilTo.visibility = View.VISIBLE
|
||||
binding.btnPickContact.visibility = View.VISIBLE
|
||||
binding.btnScanQr.visibility = View.VISIBLE
|
||||
binding.tilTo.error = null
|
||||
// Re-apply MFAISA-mode if needed (hides QR/contact picker + sets phone keyboard)
|
||||
applyMfaisaToFieldMode(selectedAccount?.bank == "MFAISA")
|
||||
updateTransferButton()
|
||||
binding.btnClearToInfo.setOnClickListener { clearRecipient() }
|
||||
// Tapping the recipient card changes the transfer type, when the lookup offered more than one
|
||||
binding.cardToInfo.setOnClickListener {
|
||||
if (draft.transferTypes.size > 1) showTransferTypePicker()
|
||||
}
|
||||
|
||||
binding.etTo.addTextChangedListener {
|
||||
binding.tilTo.error = null
|
||||
// Options looked up for a different number no longer apply
|
||||
val offeredFor = draft.transferTypeNumber
|
||||
if (offeredFor.isNotEmpty() && AccountInputParser.normalize(it?.toString().orEmpty().trim()) != offeredFor)
|
||||
resetTransferTypes()
|
||||
if (binding.cardToInfo.visibility == View.VISIBLE) {
|
||||
resolvedAccountNumber = ""
|
||||
resolvedRecipientName = ""
|
||||
@@ -866,6 +982,32 @@ class TransferFragment : Fragment() {
|
||||
setupContactDropdown()
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops the resolved recipient and brings the "To" field back. The transfer type options go
|
||||
* too unless [keepTransferTypes] — the source changed under a picked type, and the user
|
||||
* should be able to choose again for the same number.
|
||||
*/
|
||||
private fun clearRecipient(keepTransferTypes: Boolean = false) {
|
||||
bmlHandler().clearQrMerchant()
|
||||
bmlHandler().clearCardMerchant()
|
||||
mfaisaHandler().clearQrMerchant()
|
||||
resolvedAccountNumber = ""
|
||||
resolvedRecipientName = ""
|
||||
resolvedDestCurrency = ""
|
||||
resolvedToOwnAccount = null
|
||||
fahipayHandler?.clearState()
|
||||
if (!keepTransferTypes) resetTransferTypes()
|
||||
mfaisaHandler?.clearState()
|
||||
binding.cardToInfo.visibility = View.GONE
|
||||
binding.tilTo.visibility = View.VISIBLE
|
||||
binding.btnPickContact.visibility = View.VISIBLE
|
||||
binding.btnScanQr.visibility = View.VISIBLE
|
||||
binding.tilTo.error = null
|
||||
// Re-apply MFAISA-mode if needed (hides QR/contact picker + sets phone keyboard)
|
||||
applyMfaisaToFieldMode(selectedAccount?.bank == "MFAISA")
|
||||
updateTransferButton()
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches this screen into BML merchant-QR mode, keeping a selected BML card as the source.
|
||||
* Done in place: reopening the screen for it rebuilt the whole form and made the To row
|
||||
@@ -969,6 +1111,15 @@ class TransferFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun lookupAccount() {
|
||||
val accountNumber = AccountInputParser.normalize(binding.etTo.text?.toString()?.trim() ?: "")
|
||||
|
||||
// No source yet and a phone number: look it up every way it could be paid and let the
|
||||
// user pick the transfer type, which then picks the source
|
||||
if (selectedAccount == null && AccountInputParser.detect(accountNumber) == AccountInputParser.InputType.PHONE) {
|
||||
lookupPhoneForAnySource(accountNumber)
|
||||
return
|
||||
}
|
||||
|
||||
if (selectedAccount == null) {
|
||||
val defaultNum = CredentialStore(requireContext()).getDefaultAccountNumber()
|
||||
if (defaultNum != null) {
|
||||
@@ -986,7 +1137,6 @@ class TransferFragment : Fragment() {
|
||||
return
|
||||
}
|
||||
}
|
||||
val accountNumber = AccountInputParser.normalize(binding.etTo.text?.toString()?.trim() ?: "")
|
||||
if (accountNumber.isBlank()) {
|
||||
Toast.makeText(requireContext(), R.string.transfer_enter_account_first, Toast.LENGTH_SHORT).show()
|
||||
return
|
||||
@@ -1013,100 +1163,147 @@ class TransferFragment : Fragment() {
|
||||
return
|
||||
}
|
||||
|
||||
val mibSess = mibHandler.session
|
||||
val bmlSess = bmlSessionFor(selectedAccount)
|
||||
if (mibSess == null && bmlSess == null) {
|
||||
if (mibHandler.session == null && bmlSessionFor(selectedAccount) == null) {
|
||||
Toast.makeText(requireContext(), R.string.transfer_session_unavailable, Toast.LENGTH_SHORT).show()
|
||||
return
|
||||
}
|
||||
|
||||
val isBmlSource = selectedAccount?.bank == "BML"
|
||||
val preferBml = selectedAccount?.bank == "BML"
|
||||
|
||||
startLookupLoading()
|
||||
|
||||
// Both banks can resolve a destination, so whichever the source belongs to gets first
|
||||
// try and the other is the fallback. Either way the result lands in MibIpsAccountInfo.
|
||||
viewLifecycleOwner.lifecycleScope.launch {
|
||||
var errorMsg: String? = null
|
||||
val info = withContext(Dispatchers.IO) {
|
||||
if (isBmlSource && bmlSess != null) {
|
||||
val isMibDest = AccountInputParser.detect(accountNumber) == AccountInputParser.InputType.MIB_ACCOUNT
|
||||
val bmlInfo = bmlHandler().validateDestination(bmlSess, accountNumber, verifyAsMib = isMibDest)
|
||||
if (bmlInfo != null) {
|
||||
// BML's MIB verify endpoint doesn't return the account's currency.
|
||||
// Enrich via MIB lookup when a MIB session is available.
|
||||
if (isMibDest && bmlInfo.currency.isBlank() && mibSess != null)
|
||||
bmlInfo.copy(currency = mibHandler.lookupCurrency(bmlInfo.accountNumber))
|
||||
else bmlInfo
|
||||
} else {
|
||||
val outcome = mibHandler.lookupDestination(accountNumber)
|
||||
errorMsg = outcome.error
|
||||
outcome.info
|
||||
}
|
||||
} else {
|
||||
val outcome = mibHandler.lookupDestination(accountNumber)
|
||||
errorMsg = outcome.error
|
||||
if (outcome.info != null) {
|
||||
outcome.info
|
||||
} else {
|
||||
val bmlInfo = bmlSess?.let {
|
||||
bmlHandler().validateDestination(it, accountNumber, verifyAsMib = false)
|
||||
}
|
||||
if (bmlInfo != null) errorMsg = null
|
||||
else if (errorMsg == null) errorMsg = getString(R.string.transfer_account_not_found)
|
||||
bmlInfo
|
||||
}
|
||||
val (info, errorMsg) = withContext(Dispatchers.IO) { lookupFavara(accountNumber, preferBml) }
|
||||
stopLookupLoading()
|
||||
if (info != null) showFavaraRecipient(info)
|
||||
else Toast.makeText(requireContext(), errorMsg, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A phone number searched before any source is picked. Runs the Favara lookup (through MIB
|
||||
* or BML, whichever is logged in) and, when the user has a Fahipay wallet, the Dhiraagu /
|
||||
* Ooredoo carrier lookup — in parallel — and offers whatever came back as transfer types.
|
||||
*/
|
||||
private fun lookupPhoneForAnySource(number: String) {
|
||||
val accounts = viewModel.accounts.value ?: emptyList()
|
||||
val hasFahipay = accounts.any { it.bank == "FAHIPAY" }
|
||||
val hasFavara = mibHandler.session != null || bmlSessionFor(null) != null
|
||||
if (!hasFavara && !hasFahipay) {
|
||||
Toast.makeText(requireContext(), R.string.transfer_no_from_account, Toast.LENGTH_SHORT).show()
|
||||
return
|
||||
}
|
||||
// Favara goes through the default account's bank first, as it would once that's the source
|
||||
val defaultNum = CredentialStore(requireContext()).getDefaultAccountNumber()
|
||||
val preferBml = accounts.firstOrNull { it.accountNumber == defaultNum }?.bank == "BML"
|
||||
val fahipay = fahipayHandler()
|
||||
|
||||
resetTransferTypes()
|
||||
startLookupLoading()
|
||||
viewLifecycleOwner.lifecycleScope.launch {
|
||||
val (favara, fahipayTypes) = withContext(Dispatchers.IO) {
|
||||
coroutineScope {
|
||||
val favara = async { if (hasFavara) lookupFavara(number, preferBml) else null to null }
|
||||
val fahipayTypes = async { if (hasFahipay) fahipay.lookupServices(number) else emptyList() }
|
||||
favara.await() to fahipayTypes.await()
|
||||
}
|
||||
}
|
||||
stopLookupLoading()
|
||||
if (info != null) {
|
||||
val accounts = viewModel.accounts.value ?: emptyList()
|
||||
val matchedAcc = accounts.firstOrNull { it.accountNumber == info.accountNumber }
|
||||
val matchedCont = contacts.firstOrNull { it.benefAccount == info.accountNumber }
|
||||
|
||||
val displayName = matchedAcc?.accountBriefName ?: matchedCont?.benefNickName ?: info.accountName
|
||||
val colorHex = if (matchedAcc != null) "#FE860E" else matchedCont?.bankColor ?: "#607D8B"
|
||||
|
||||
resolvedAccountNumber = info.accountNumber
|
||||
resolvedRecipientName = info.accountName
|
||||
resolvedBankName = info.bankId
|
||||
resolvedDestCurrency = info.currency
|
||||
savedToSubtitle = listOfNotNull(info.accountNumber, info.bankId, info.currency.takeIf { it.isNotBlank() })
|
||||
.joinToString(" · ")
|
||||
savedToColorHex = colorHex
|
||||
savedToImageHash = when {
|
||||
matchedAcc?.profileImageHash != null -> matchedAcc.profileImageHash
|
||||
matchedCont?.customerImgHash != null -> matchedCont.customerImgHash
|
||||
else -> null
|
||||
}
|
||||
|
||||
if (matchedAcc != null) {
|
||||
showToCard(matchedAcc)
|
||||
} else {
|
||||
binding.tvToAccountName.text = displayName
|
||||
binding.tvToBankBic.text = savedToSubtitle
|
||||
binding.tvToAccountDetails.visibility = View.GONE
|
||||
binding.tvToBalance.visibility = View.GONE
|
||||
binding.ivToPhoto.scaleType = android.widget.ImageView.ScaleType.CENTER_CROP
|
||||
binding.ivToPhoto.setImageBitmap(makeInitialsBitmap(displayName, colorHex))
|
||||
}
|
||||
binding.tilTo.visibility = View.GONE
|
||||
binding.btnPickContact.visibility = View.GONE
|
||||
binding.btnScanQr.visibility = View.GONE
|
||||
binding.cardToInfo.visibility = View.VISIBLE
|
||||
updateTransferButton()
|
||||
saveToRecents(info)
|
||||
focusAmount()
|
||||
|
||||
when {
|
||||
matchedAcc?.profileImageHash != null ->
|
||||
loadToPhoto(matchedAcc.profileImageHash, isProfile = true)
|
||||
matchedCont?.customerImgHash != null ->
|
||||
loadToPhoto(matchedCont.customerImgHash, isProfile = false)
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(requireContext(), errorMsg, Toast.LENGTH_SHORT).show()
|
||||
val types = listOfNotNull(favara.first?.let { TransferType.Favara(it) }) + fahipayTypes
|
||||
if (types.isEmpty()) {
|
||||
Toast.makeText(requireContext(), favara.second ?: getString(R.string.transfer_account_not_found), Toast.LENGTH_SHORT).show()
|
||||
return@launch
|
||||
}
|
||||
offerTransferTypes(number, types)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Favara / IPS lookup of [accountNumber], returning the resolved recipient or the error to
|
||||
* show. Both banks can resolve a destination, so [preferBml] decides which gets first try
|
||||
* and the other is the fallback. Either way the result lands in MibIpsAccountInfo.
|
||||
* Blocking — call from IO.
|
||||
*/
|
||||
private fun lookupFavara(accountNumber: String, preferBml: Boolean): Pair<MibIpsAccountInfo?, String?> {
|
||||
val mibSess = mibHandler.session
|
||||
val bmlSess = bmlSessionFor(selectedAccount)
|
||||
var errorMsg: String? = null
|
||||
val info = if (preferBml && bmlSess != null) {
|
||||
val isMibDest = AccountInputParser.detect(accountNumber) == AccountInputParser.InputType.MIB_ACCOUNT
|
||||
val bmlInfo = bmlHandler().validateDestination(bmlSess, accountNumber, verifyAsMib = isMibDest)
|
||||
if (bmlInfo != null) {
|
||||
// BML's MIB verify endpoint doesn't return the account's currency.
|
||||
// Enrich via MIB lookup when a MIB session is available.
|
||||
if (isMibDest && bmlInfo.currency.isBlank() && mibSess != null)
|
||||
bmlInfo.copy(currency = mibHandler.lookupCurrency(bmlInfo.accountNumber))
|
||||
else bmlInfo
|
||||
} else {
|
||||
val outcome = mibHandler.lookupDestination(accountNumber)
|
||||
errorMsg = outcome.error
|
||||
outcome.info
|
||||
}
|
||||
} else {
|
||||
val outcome = mibHandler.lookupDestination(accountNumber)
|
||||
errorMsg = outcome.error
|
||||
if (outcome.info != null) {
|
||||
outcome.info
|
||||
} else {
|
||||
val bmlInfo = bmlSess?.let {
|
||||
bmlHandler().validateDestination(it, accountNumber, verifyAsMib = false)
|
||||
}
|
||||
if (bmlInfo != null) errorMsg = null
|
||||
else if (errorMsg == null) errorMsg = getString(R.string.transfer_account_not_found)
|
||||
bmlInfo
|
||||
}
|
||||
}
|
||||
return info to errorMsg
|
||||
}
|
||||
|
||||
/** Fills the recipient card with a Favara / IPS lookup result. */
|
||||
private fun showFavaraRecipient(info: MibIpsAccountInfo) {
|
||||
val accounts = viewModel.accounts.value ?: emptyList()
|
||||
val contacts = viewModel.contacts.value ?: emptyList()
|
||||
val matchedAcc = accounts.firstOrNull { it.accountNumber == info.accountNumber }
|
||||
val matchedCont = contacts.firstOrNull { it.benefAccount == info.accountNumber }
|
||||
|
||||
val displayName = matchedAcc?.accountBriefName ?: matchedCont?.benefNickName ?: info.accountName
|
||||
val colorHex = if (matchedAcc != null) "#FE860E" else matchedCont?.bankColor ?: "#607D8B"
|
||||
|
||||
resolvedAccountNumber = info.accountNumber
|
||||
resolvedRecipientName = info.accountName
|
||||
resolvedBankName = info.bankId
|
||||
resolvedDestCurrency = info.currency
|
||||
savedToSubtitle = listOfNotNull(info.accountNumber, info.bankId, info.currency.takeIf { it.isNotBlank() })
|
||||
.joinToString(" · ")
|
||||
savedToColorHex = colorHex
|
||||
savedToImageHash = when {
|
||||
matchedAcc?.profileImageHash != null -> matchedAcc.profileImageHash
|
||||
matchedCont?.customerImgHash != null -> matchedCont.customerImgHash
|
||||
else -> null
|
||||
}
|
||||
|
||||
if (matchedAcc != null) {
|
||||
showToCard(matchedAcc)
|
||||
} else {
|
||||
binding.tvToAccountName.text = displayName
|
||||
binding.tvToBankBic.text = savedToSubtitle
|
||||
binding.tvToAccountDetails.visibility = View.GONE
|
||||
binding.tvToBalance.visibility = View.GONE
|
||||
binding.ivToPhoto.scaleType = android.widget.ImageView.ScaleType.CENTER_CROP
|
||||
binding.ivToPhoto.setImageBitmap(makeInitialsBitmap(displayName, colorHex))
|
||||
}
|
||||
binding.tilTo.visibility = View.GONE
|
||||
binding.btnPickContact.visibility = View.GONE
|
||||
binding.btnScanQr.visibility = View.GONE
|
||||
binding.cardToInfo.visibility = View.VISIBLE
|
||||
updateTransferButton()
|
||||
saveToRecents(info)
|
||||
focusAmount()
|
||||
|
||||
when {
|
||||
matchedAcc?.profileImageHash != null ->
|
||||
loadToPhoto(matchedAcc.profileImageHash, isProfile = true)
|
||||
matchedCont?.customerImgHash != null ->
|
||||
loadToPhoto(matchedCont.customerImgHash, isProfile = false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1696,7 +1893,7 @@ class TransferFragment : Fragment() {
|
||||
if (bmlHandler().isOtpFlowActive) return
|
||||
val amount = binding.etAmount.text?.toString()?.trim()?.toDoubleOrNull() ?: 0.0
|
||||
val recipientReady = bmlHandler().hasQrMerchant || bmlHandler().hasCardMerchant || mfaisaHandler().hasQrMerchant || resolvedAccountNumber.isNotBlank()
|
||||
val hasAll = selectedAccount != null && recipientReady && amount > 0
|
||||
val hasAll = selectedAccount != null && recipientReady && amount > 0 && !transferTypePending
|
||||
if (!hasAll) { binding.btnTransfer.isEnabled = false; return }
|
||||
val errors = viewModel.connectivityErrors.value ?: emptySet()
|
||||
val bankOffline = "NO_INTERNET" in errors ||
|
||||
@@ -1726,7 +1923,7 @@ class TransferFragment : Fragment() {
|
||||
resolvedBankName = ""
|
||||
resolvedDestCurrency = ""
|
||||
resolvedToOwnAccount = null
|
||||
fahipayHandler().clearState()
|
||||
resetTransferTypes()
|
||||
binding.cardToInfo.visibility = View.GONE
|
||||
binding.tilTo.visibility = View.VISIBLE
|
||||
binding.btnPickContact.visibility = View.VISIBLE
|
||||
@@ -1827,6 +2024,10 @@ class TransferFragment : Fragment() {
|
||||
bmlHandler = null
|
||||
fahipayHandler = null
|
||||
mfaisaHandler = null
|
||||
// Re-shown from the draft by the next view if still unanswered
|
||||
transferTypeDialog?.setOnDismissListener(null)
|
||||
transferTypeDialog?.dismiss()
|
||||
transferTypeDialog = null
|
||||
// Unregistered automatically with viewLifecycleOwner; drop the stale handle.
|
||||
qrLauncher = null
|
||||
_binding = null
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package sh.sar.basedbank.ui.home.transfer
|
||||
|
||||
import android.view.View
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
@@ -15,24 +15,28 @@ import sh.sar.basedbank.util.AccountInputParser
|
||||
|
||||
/**
|
||||
* A service a Fahipay wallet can pay out to. The carrier lookup decides which of these apply to
|
||||
* a given number; [label] names it in the recipient card, [destinationLabel] in the confirm
|
||||
* dialog's "To" block.
|
||||
* a given number; [label] names it in the "Transfer Type" picker and the recipient card,
|
||||
* [destinationLabel] in the confirm dialog's "To" block.
|
||||
*
|
||||
* Wallet-to-wallet Fahipay transfer is not here yet — there is no send path for it (see the
|
||||
* class KDoc on [FahipayTransferHandler]). Add it as a constant once that lands, and the
|
||||
* exhaustive `when`s over this enum will point at every site that needs updating.
|
||||
*/
|
||||
enum class FahipayService(val label: String, val destinationLabel: String) {
|
||||
RAASTAS("Raastas", "Ooredoo · Raastas"),
|
||||
OOREDOO_BILL("Ooredoo Bill Pay", "Ooredoo · Bill Pay"),
|
||||
DHIRAAGU_RELOAD("Dhiraagu Reload", "Dhiraagu · Reload"),
|
||||
DHIRAAGU_BILL("Dhiraagu Bill Pay", "Dhiraagu · Bill Pay"),
|
||||
enum class FahipayService(
|
||||
val label: String,
|
||||
val destinationLabel: String,
|
||||
@param:DrawableRes val iconRes: Int,
|
||||
) {
|
||||
RAASTAS("Raastas", "Ooredoo · Raastas", R.drawable.ooredoo_logo),
|
||||
OOREDOO_BILL("Ooredoo Bill Pay", "Ooredoo · Bill Pay", R.drawable.ooredoo_logo),
|
||||
DHIRAAGU_RELOAD("Dhiraagu Reload", "Dhiraagu · Reload", R.drawable.dhiraagu_logo),
|
||||
DHIRAAGU_BILL("Dhiraagu Bill Pay", "Dhiraagu · Bill Pay", R.drawable.dhiraagu_logo),
|
||||
}
|
||||
|
||||
/**
|
||||
* Owns the Fahipay-only parts of the Transfer screen: the carrier lookup that turns a phone
|
||||
* number into a set of payable services, the chip picker shown when more than one applies, and
|
||||
* the selected service that the confirm dialog labels the destination with.
|
||||
* number into a set of payable services, offering those in the fragment's "Transfer Type"
|
||||
* picker, and the selected service that the confirm dialog labels the destination with.
|
||||
*
|
||||
* Mirrors [BmlTransferHandler] / [MfaisaTransferHandler]: the fragment keeps the shared confirm
|
||||
* dialog, the recipient card and the form state; the handler keeps everything Fahipay-specific.
|
||||
@@ -75,10 +79,39 @@ class FahipayTransferHandler(
|
||||
lookupCarrier(rawInput)
|
||||
}
|
||||
|
||||
/** Clears the selected service and hides the chip picker. */
|
||||
/** Forgets the selected service. The picker itself is the fragment's to reset. */
|
||||
fun clearState() {
|
||||
service = null
|
||||
binding.layoutServiceSelector.visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
/**
|
||||
* Fills the recipient card for a picked Fahipay transfer type. The fragment has already
|
||||
* switched the source to a Fahipay account.
|
||||
*/
|
||||
fun applyService(type: TransferType.Fahipay, number: String) {
|
||||
service = type.service
|
||||
val contacts = viewModel.contacts.value ?: emptyList()
|
||||
val displayName = type.ownerName
|
||||
?: contacts.firstOrNull { it.benefAccount == number }?.benefNickName
|
||||
?: number
|
||||
fragment.prefillToDirectly(
|
||||
accountNumber = number,
|
||||
displayName = displayName,
|
||||
subtitle = "${type.label} · $number",
|
||||
colorHex = "#FF6B00",
|
||||
imageHash = null
|
||||
)
|
||||
fragment.focusAmount()
|
||||
}
|
||||
|
||||
/**
|
||||
* The Fahipay transfer types [number] can be paid with, from the carrier lookup. Dhiraagu is
|
||||
* the only carrier that hands back an owner name. Blocking — call from IO.
|
||||
*/
|
||||
fun lookupServices(number: String): List<TransferType.Fahipay> {
|
||||
val result = queryCarriers(number)
|
||||
val ownerName = result.dhiraagu.ownerName.takeIf { it.isNotBlank() }
|
||||
return servicesFor(result).map { TransferType.Fahipay(it, ownerName) }
|
||||
}
|
||||
|
||||
// ─── Carrier lookup ──────────────────────────────────────────────────────
|
||||
@@ -89,24 +122,13 @@ class FahipayTransferHandler(
|
||||
)
|
||||
|
||||
private fun lookupCarrier(number: String) {
|
||||
fragment.resetTransferTypes()
|
||||
fragment.startLookupLoading()
|
||||
fragment.viewLifecycleOwner.lifecycleScope.launch {
|
||||
val result = withContext(Dispatchers.IO) { queryCarriers(number) }
|
||||
val types = withContext(Dispatchers.IO) { lookupServices(number) }
|
||||
fragment.stopLookupLoading()
|
||||
|
||||
val dhiraaguName = result.dhiraagu.ownerName.takeIf { it.isNotBlank() }
|
||||
val services = servicesFor(result)
|
||||
|
||||
if (services.isEmpty()) return@launch
|
||||
|
||||
// Only one option — auto-select, no chip UI needed
|
||||
if (services.size == 1) {
|
||||
selectService(services[0], number, dhiraaguName)
|
||||
return@launch
|
||||
}
|
||||
|
||||
// Multiple options (Ooredoo HYBRID) — show chips
|
||||
showServiceChips(services, number, dhiraaguName)
|
||||
if (types.isEmpty()) return@launch
|
||||
fragment.offerTransferTypes(number, types)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,58 +165,4 @@ class FahipayTransferHandler(
|
||||
if (result.ooredoo == OoredooClient.CustType.PRE || result.ooredoo == OoredooClient.CustType.HYBRID) add(FahipayService.RAASTAS)
|
||||
if (result.ooredoo == OoredooClient.CustType.POST || result.ooredoo == OoredooClient.CustType.HYBRID) add(FahipayService.OOREDOO_BILL)
|
||||
}
|
||||
|
||||
// ─── Service picker ──────────────────────────────────────────────────────
|
||||
|
||||
private fun showServiceChips(
|
||||
services: List<FahipayService>,
|
||||
number: String,
|
||||
dhiraaguName: String?
|
||||
) {
|
||||
binding.chipDhiraaguReload.visibility = visibilityFor(FahipayService.DHIRAAGU_RELOAD in services)
|
||||
binding.chipDhiraaguBill.visibility = visibilityFor(FahipayService.DHIRAAGU_BILL in services)
|
||||
binding.chipRaastas.visibility = visibilityFor(FahipayService.RAASTAS in services)
|
||||
binding.chipOoredooBill.visibility = visibilityFor(FahipayService.OOREDOO_BILL in services)
|
||||
binding.layoutServiceSelector.visibility = View.VISIBLE
|
||||
binding.chipGroupService.clearCheck()
|
||||
|
||||
// Dhiraagu is the only carrier that hands back an owner name, so the Ooredoo chips
|
||||
// resolve their display name from saved contacts instead.
|
||||
bindChip(binding.chipDhiraaguReload, FahipayService.DHIRAAGU_RELOAD, number, dhiraaguName)
|
||||
bindChip(binding.chipDhiraaguBill, FahipayService.DHIRAAGU_BILL, number, dhiraaguName)
|
||||
bindChip(binding.chipRaastas, FahipayService.RAASTAS, number, null)
|
||||
bindChip(binding.chipOoredooBill, FahipayService.OOREDOO_BILL, number, null)
|
||||
}
|
||||
|
||||
private fun bindChip(
|
||||
chip: com.google.android.material.chip.Chip,
|
||||
picked: FahipayService,
|
||||
number: String,
|
||||
ownerName: String?
|
||||
) {
|
||||
chip.setOnCheckedChangeListener { _, checked ->
|
||||
if (checked) {
|
||||
selectService(picked, number, ownerName)
|
||||
binding.layoutServiceSelector.visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun visibilityFor(shown: Boolean) = if (shown) View.VISIBLE else View.GONE
|
||||
|
||||
private fun selectService(picked: FahipayService, number: String, ownerName: String?) {
|
||||
service = picked
|
||||
val contacts = viewModel.contacts.value ?: emptyList()
|
||||
val displayName = ownerName
|
||||
?: contacts.firstOrNull { it.benefAccount == number }?.benefNickName
|
||||
?: number
|
||||
fragment.prefillToDirectly(
|
||||
accountNumber = number,
|
||||
displayName = displayName,
|
||||
subtitle = "${picked.label} · $number",
|
||||
colorHex = "#FF6B00",
|
||||
imageHash = null
|
||||
)
|
||||
fragment.focusAmount()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,11 @@ class TransferDraft {
|
||||
var mfaisaRecipient: MfaisaTransferClient.Recipient? = null
|
||||
var mfaisaQrInfo: MfaisaQrPayClient.QrMerchant? = null
|
||||
|
||||
// Transfer type — options the "To" lookup offered for [transferTypeNumber], and the pick
|
||||
var transferTypes: List<TransferType> = emptyList()
|
||||
var transferTypeNumber = ""
|
||||
var transferType: TransferType? = null
|
||||
|
||||
// Fahipay
|
||||
var fahipayService: FahipayService? = null
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package sh.sar.basedbank.ui.home.transfer
|
||||
|
||||
import androidx.annotation.DrawableRes
|
||||
import sh.sar.basedbank.R
|
||||
import sh.sar.basedbank.api.mib.MibIpsAccountInfo
|
||||
import sh.sar.basedbank.api.models.BankAccount
|
||||
|
||||
/**
|
||||
* One option in the Transfer screen's "Transfer Type" picker: a way of paying the number in
|
||||
* the "To" field. Picking one also decides the source account — see [worksFrom].
|
||||
*
|
||||
* Add new kinds (BML verified card, …) as subclasses; the exhaustive `when`s over this type
|
||||
* point at every site that needs updating.
|
||||
*/
|
||||
sealed interface TransferType {
|
||||
val label: String
|
||||
/** Second line in the picker: who gets paid, and how. */
|
||||
val subtitle: String
|
||||
@get:DrawableRes val iconRes: Int
|
||||
/** Small logo on the icon's bottom corner — the wallet that pays it — or null for none. */
|
||||
@get:DrawableRes val badgeRes: Int? get() = null
|
||||
|
||||
/** Whether [account] can be the source for this transfer type. */
|
||||
fun worksFrom(account: BankAccount): Boolean
|
||||
|
||||
/** A bank transfer to the account the Favara ID (phone number) resolved to. */
|
||||
data class Favara(val info: MibIpsAccountInfo) : TransferType {
|
||||
override val label get() = "Favara Transfer"
|
||||
override val subtitle get() = info.accountName
|
||||
override val iconRes get() = R.drawable.favara_logo
|
||||
override fun worksFrom(account: BankAccount) = account.bank == "MIB" || account.bank == "BML"
|
||||
}
|
||||
|
||||
/** A Fahipay payout (reload, Raastas, bill pay) to the phone number. */
|
||||
data class Fahipay(val service: FahipayService, val ownerName: String?) : TransferType {
|
||||
override val label get() = service.label
|
||||
override val subtitle get() = listOfNotNull(ownerName, "via Fahipay").joinToString(" · ")
|
||||
override val iconRes get() = service.iconRes
|
||||
override val badgeRes get() = R.drawable.fahipay_logo
|
||||
override fun worksFrom(account: BankAccount) = account.bank == "FAHIPAY"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- The Dhiraagu mark alone, cropped square from dhiraagu_long.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="48.491"
|
||||
android:viewportHeight="48.491">
|
||||
|
||||
<group
|
||||
android:translateX="0.086"
|
||||
android:translateY="3.591">
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M22.1561 2.71843C21.9696 2.07394 21.5428 1.54073 20.9538 1.21798C20.3648 0.894216 19.6856 0.818335 19.0398 1.0045C18.394 1.19168 17.8598 1.61763 17.5354 2.20445C17.2109 2.79228 17.1349 3.47016 17.3225 4.11466L20.1397 14.2748C20.4489 15.3422 21.4424 16.0879 22.5556 16.0879C22.7918 16.0879 23.027 16.0545 23.2561 15.9887C23.9019 15.8025 24.4361 15.3756 24.7605 14.7887C25.0849 14.2009 25.16 13.523 24.9734 12.8785L22.1561 2.71843Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M13.7864 19.9944C14.4382 20.0257 15.0546 19.7475 15.528 19.2922C16.0116 18.8268 16.2863 18.2015 16.2985 17.5307C16.3117 16.8599 16.0613 16.2246 15.596 15.7409L9.39471 9.38302C8.43263 8.38542 6.83695 8.35506 5.83737 9.31523C5.3538 9.78064 5.08008 10.4059 5.0669 11.0757C5.05372 11.7465 5.30412 12.3819 5.76945 12.8645L11.9707 19.2234C11.9707 19.2234 12.655 19.9387 13.7864 19.9934V19.9944Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M9.72223 23.0954L3.10228 21.5596C2.44941 21.4038 1.77424 21.511 1.20145 21.8621C0.62867 22.2132 0.227216 22.7656 0.0700814 23.4182C-0.0860399 24.0708 0.020406 24.7446 0.372186 25.3163C0.723966 25.8879 1.27749 26.2886 1.93137 26.4444L8.55132 27.9802C8.74394 28.0258 8.94162 28.049 9.1383 28.049C10.3062 28.049 11.3118 27.2568 11.5835 26.1216C11.7396 25.469 11.6322 24.7952 11.2804 24.2236C10.9286 23.6519 10.3751 23.2513 9.72122 23.0954H9.72223Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M47.6209 19.5174C47.1373 19.052 46.4996 18.8031 45.8285 18.8163C45.1564 18.8294 44.5299 19.1026 44.0635 19.5852L38.4188 25.3563C37.9525 25.8399 37.7031 26.4753 37.7153 27.1461C37.7284 27.8169 38.0022 28.4422 38.4867 28.9076C38.9571 29.3599 39.5776 29.6098 40.2315 29.6098C40.9218 29.6098 41.5656 29.3366 42.0441 28.8398L47.6888 23.0687C48.1551 22.5851 48.4045 21.9497 48.3913 21.2799C48.3782 20.6091 48.1044 19.9839 47.6209 19.5184V19.5174Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M24.497 18.6561H28.1151C28.1151 18.6561 28.329 23.4933 24.4179 23.4933C23.1608 23.4933 21.8997 23.9344 20.8413 24.7863C18.4539 26.7097 17.9662 30.1881 19.7343 32.6902C21.6544 35.4068 25.4418 35.9694 28.0675 33.9711C29.5618 32.8329 30.3211 31.2131 30.3657 29.3676C30.3657 29.3646 30.3667 29.3615 30.3688 29.3575V2.46688C30.3688 1.06761 31.5366 -0.0787268 32.9356 0.0042377C34.2039 0.0801199 35.2085 1.13034 35.2085 2.41527V28.6361C35.2085 29.9048 35.0433 31.1696 34.6945 32.3897C34.4593 33.2103 34.1289 34.0703 33.6625 34.8625C32.9894 35.9724 32.1003 36.9771 31.0034 37.8128C26.3096 41.3873 19.6004 40.4859 16.0188 35.8004C12.4371 31.1149 13.3404 24.4201 18.0342 20.8455C18.0342 20.8455 19.0804 20.026 20.5585 19.4149C21.6189 18.9778 22.7431 18.7309 23.9475 18.6702L24.497 18.6561Z" />
|
||||
|
||||
</group>
|
||||
|
||||
</vector>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="169dp"
|
||||
android:height="40dp"
|
||||
android:viewportWidth="169"
|
||||
android:viewportHeight="40">
|
||||
|
||||
<!-- Mark -->
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M22.1561 2.71843C21.9696 2.07394 21.5428 1.54073 20.9538 1.21798C20.3648 0.894216 19.6856 0.818335 19.0398 1.0045C18.394 1.19168 17.8598 1.61763 17.5354 2.20445C17.2109 2.79228 17.1349 3.47016 17.3225 4.11466L20.1397 14.2748C20.4489 15.3422 21.4424 16.0879 22.5556 16.0879C22.7918 16.0879 23.027 16.0545 23.2561 15.9887C23.9019 15.8025 24.4361 15.3756 24.7605 14.7887C25.0849 14.2009 25.16 13.523 24.9734 12.8785L22.1561 2.71843Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M13.7864 19.9944C14.4382 20.0257 15.0546 19.7475 15.528 19.2922C16.0116 18.8268 16.2863 18.2015 16.2985 17.5307C16.3117 16.8599 16.0613 16.2246 15.596 15.7409L9.39471 9.38302C8.43263 8.38542 6.83695 8.35506 5.83737 9.31523C5.3538 9.78064 5.08008 10.4059 5.0669 11.0757C5.05372 11.7465 5.30412 12.3819 5.76945 12.8645L11.9707 19.2234C11.9707 19.2234 12.655 19.9387 13.7864 19.9934V19.9944Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M9.72223 23.0954L3.10228 21.5596C2.44941 21.4038 1.77424 21.511 1.20145 21.8621C0.62867 22.2132 0.227216 22.7656 0.0700814 23.4182C-0.0860399 24.0708 0.020406 24.7446 0.372186 25.3163C0.723966 25.8879 1.27749 26.2886 1.93137 26.4444L8.55132 27.9802C8.74394 28.0258 8.94162 28.049 9.1383 28.049C10.3062 28.049 11.3118 27.2568 11.5835 26.1216C11.7396 25.469 11.6322 24.7952 11.2804 24.2236C10.9286 23.6519 10.3751 23.2513 9.72122 23.0954H9.72223Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M47.6209 19.5174C47.1373 19.052 46.4996 18.8031 45.8285 18.8163C45.1564 18.8294 44.5299 19.1026 44.0635 19.5852L38.4188 25.3563C37.9525 25.8399 37.7031 26.4753 37.7153 27.1461C37.7284 27.8169 38.0022 28.4422 38.4867 28.9076C38.9571 29.3599 39.5776 29.6098 40.2315 29.6098C40.9218 29.6098 41.5656 29.3366 42.0441 28.8398L47.6888 23.0687C48.1551 22.5851 48.4045 21.9497 48.3913 21.2799C48.3782 20.6091 48.1044 19.9839 47.6209 19.5184V19.5174Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M24.497 18.6561H28.1151C28.1151 18.6561 28.329 23.4933 24.4179 23.4933C23.1608 23.4933 21.8997 23.9344 20.8413 24.7863C18.4539 26.7097 17.9662 30.1881 19.7343 32.6902C21.6544 35.4068 25.4418 35.9694 28.0675 33.9711C29.5618 32.8329 30.3211 31.2131 30.3657 29.3676C30.3657 29.3646 30.3667 29.3615 30.3688 29.3575V2.46688C30.3688 1.06761 31.5366 -0.0787268 32.9356 0.0042377C34.2039 0.0801199 35.2085 1.13034 35.2085 2.41527V28.6361C35.2085 29.9048 35.0433 31.1696 34.6945 32.3897C34.4593 33.2103 34.1289 34.0703 33.6625 34.8625C32.9894 35.9724 32.1003 36.9771 31.0034 37.8128C26.3096 41.3873 19.6004 40.4859 16.0188 35.8004C12.4371 31.1149 13.3404 24.4201 18.0342 20.8455C18.0342 20.8455 19.0804 20.026 20.5585 19.4149C21.6189 18.9778 22.7431 18.7309 23.9475 18.6702L24.497 18.6561Z" />
|
||||
|
||||
<!-- Wordmark -->
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M65.8877 16.7821H67.9984C67.9984 16.7821 68.1069 19.873 65.7143 19.873C65.2196 19.873 64.4927 20.1098 63.925 20.5671C62.6426 21.6001 62.38 23.4688 63.3299 24.8135C64.361 26.2734 66.3956 26.5749 67.8058 25.5015C68.6087 24.8903 69.0172 24.0202 69.0395 23.0287C69.0395 23.0267 69.0395 23.0257 69.0416 23.0236V20.6956L69.0365 12.2565H72.1346V22.6038C72.1346 23.3434 72.0383 24.0819 71.8345 24.7932C71.6976 25.2708 71.505 25.7736 71.2333 26.235C70.84 26.8825 70.322 27.4693 69.6823 27.956C66.9441 30.0412 63.0299 29.5151 60.9415 26.7823C58.8521 24.0496 59.3793 20.1432 62.1175 18.0589C62.1175 18.0589 62.7278 17.5814 63.5905 17.2242C64.2079 16.9693 64.8648 16.8256 65.5673 16.7902L65.8877 16.7821Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M116.569 29.4027H118.68C118.68 29.4027 118.787 26.3117 116.396 26.3117C115.901 26.3117 115.174 26.075 114.607 25.6177C113.323 24.5846 113.062 22.7159 114.012 21.3713C115.043 19.9113 117.077 19.6098 118.487 20.6843C119.29 21.2954 119.699 22.1655 119.722 23.1571C119.722 23.1591 119.722 23.1601 119.724 23.1621V25.4902L119.719 29.2893H122.817V23.581C122.817 22.8414 122.721 22.1028 122.517 21.3915C122.38 20.913 122.187 20.4111 121.915 19.9498C121.522 19.3022 121.004 18.7154 120.364 18.2288C117.626 16.1435 113.712 16.6696 111.623 19.4024C109.534 22.1352 110.061 26.0416 112.799 28.1258C112.799 28.1258 113.409 28.6034 114.272 28.9605C114.891 29.2155 115.546 29.3591 116.248 29.3946L116.569 29.4027Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M132.317 29.4027H134.428C134.428 29.4027 134.535 26.3117 132.144 26.3117C131.649 26.3117 130.922 26.075 130.354 25.6177C129.071 24.5846 128.809 22.7159 129.759 21.3713C130.79 19.9113 132.825 19.6098 134.235 20.6843C135.038 21.2954 135.447 22.1655 135.47 23.1571C135.47 23.1591 135.47 23.1601 135.472 23.1621V25.4902L135.467 29.2893H138.565V23.581C138.565 22.8414 138.469 22.1028 138.265 21.3915C138.128 20.913 137.934 20.4111 137.663 19.9498C137.269 19.3022 136.75 18.7154 136.112 18.2288C133.374 16.1435 129.459 16.6696 127.371 19.4024C125.282 22.1352 125.809 26.0416 128.547 28.1258C128.547 28.1258 129.157 28.6034 130.02 28.9605C130.638 29.2155 131.294 29.3591 131.996 29.3946L132.317 29.4027Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M83.4124 16.9528C82.0955 16.9528 80.8029 17.14 80.0233 18.1376V12.2572H76.9272V29.2892H80.0233V23.3279C80.0233 20.9917 81.1446 19.9456 82.9247 19.9456C84.5579 19.9456 85.6315 20.7975 85.6315 23.0608V29.2892H88.7276V22.8655C88.7276 19.3375 86.9231 16.9528 83.4124 16.9528Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M165.904 17.1637V23.3931C165.904 25.5006 164.973 26.3829 163.527 26.4942C162.079 26.3829 161.148 25.5006 161.148 23.3931V17.1637H158.052V23.5874C158.052 27.1154 159.856 29.5001 163.366 29.5001C163.42 29.5001 163.473 29.5001 163.526 29.4981C163.578 29.4981 163.631 29.5001 163.685 29.5001C167.195 29.5001 169 27.1154 169 23.5874V17.1637H165.904Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:pathData="M95.9721 17.1224H92.876V29.2889H95.9721V17.1224Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M106.412 16.9529C105.472 16.9529 104.531 17.1684 103.687 17.5761C103.543 17.6449 103.405 17.7208 103.269 17.8007L103.267 17.8028C102.563 18.2105 101.953 18.7467 101.451 19.4034C101.218 19.7089 101.018 20.0327 100.848 20.3676C100.411 21.1628 100.173 22.0623 100.173 22.9891V29.3318H103.27V23.2491C103.255 22.6015 103.451 21.9459 103.849 21.3804C104.435 20.5507 105.393 20.056 106.413 20.056H107.834V16.9549H106.413L106.412 16.9529Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M94.3459 12.6085C95.2451 12.6085 95.973 13.335 95.973 14.2324C95.973 15.1298 95.2451 15.8563 94.3459 15.8563C93.4466 15.8563 92.7188 15.1288 92.7188 14.2324C92.7188 13.336 93.4466 12.6085 94.3459 12.6085Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#F15625"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M154.484 26.5717V23.5809C154.484 22.8413 154.387 22.1027 154.184 21.3915C154.047 20.9129 153.853 20.4111 153.582 19.9497C153.19 19.3022 152.671 18.7154 152.031 18.2287C149.293 16.1435 145.379 16.6686 143.291 19.4023C141.201 22.1351 141.728 26.0415 144.467 28.1258C144.467 28.1258 145.077 28.6043 145.94 28.9595C146.558 29.2154 147.214 29.3591 147.916 29.3945L148.237 29.4026H150.348C150.348 29.4026 150.456 26.3107 148.063 26.3107C147.57 26.3107 146.843 26.0739 146.275 25.6166C144.993 24.5846 144.731 22.7149 145.68 21.3712C146.711 19.9113 148.746 19.6098 150.156 20.6832C150.959 21.2943 151.367 22.1655 151.39 23.157C151.39 23.159 151.39 23.16 151.391 23.162V23.6052H151.386V26.5727V28.8906C151.371 30.6349 150.186 31.5202 148.427 31.5202C147.069 31.5445 145.977 31.157 144.813 30.5762L143.067 32.4399C144.376 33.5306 146.196 34.3289 148.428 34.3289C152.214 34.3289 154.625 31.8369 154.478 28.1551V26.5727H154.484V26.5717Z" />
|
||||
|
||||
</vector>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- The Favara mark alone, cropped square from favara_long.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="317.610"
|
||||
android:viewportHeight="317.610">
|
||||
|
||||
<group
|
||||
android:translateX="-123.226"
|
||||
android:translateY="-123.588">
|
||||
|
||||
<path
|
||||
android:fillColor="#005CA3"
|
||||
android:pathData="M262.476 321.671C254.92 326.026 245.261 323.404 240.951 315.848C236.596 308.314 239.212 298.678 246.735 294.323L301.63 262.653C309.197 258.287 318.845 260.903 323.167 268.47C327.521 275.988 324.905 285.636 317.333 290.001L262.476 321.671ZM272.472 371.936L272.438 371.98L238.014 391.849L237.932 391.894H237.899V391.927H237.854L233.616 394.394C232.887 394.78 232.153 395.167 231.419 395.437C227.368 397.518 223.421 399.212 219.602 400.266C210.043 402.844 201.366 401.828 193.882 394.824C185.962 387.329 178.24 379.646 170.717 371.743C163.195 363.883 155.865 355.77 148.695 347.446C132.016 328.029 123.952 305.157 123.952 282.054C123.952 258.663 132.253 235.172 148.298 215.071C158.569 202.217 169.371 190.146 180.751 178.804C191.945 167.616 203.756 157.118 216.174 147.283C236.16 131.47 258.927 123.588 281.838 123.588C304.831 123.588 327.792 131.503 347.926 147.167C360.207 156.693 372.073 167.196 383.537 178.655C394.852 189.919 405.653 202.101 415.875 215.187C431.809 235.476 440.11 259.049 440.11 282.434C440.11 305.466 432.118 328.195 415.411 347.48C404.759 359.755 394.046 371.323 383.189 382.169C372.355 392.97 360.819 403.727 348.544 414.346C334.238 426.72 317.84 434.514 300.819 437.792C283.389 441.198 265.291 439.763 248.28 433.598C240.095 430.623 235.851 421.56 238.826 413.342C241.801 405.118 250.863 400.873 259.049 403.882C270.645 408.093 282.958 409.053 294.88 406.735C306.575 404.494 317.918 399.058 327.88 390.459C338.908 380.894 349.858 370.666 360.786 359.755C371.698 348.837 381.947 337.832 391.49 326.843C402.959 313.607 408.435 298.098 408.435 282.434C408.435 265.959 402.452 249.219 390.993 234.626C381.66 222.671 371.731 211.522 361.283 201.063C350.978 190.769 340.028 181.166 328.493 172.164C314.06 160.943 297.888 155.302 281.838 155.302C265.87 155.302 249.864 160.833 235.74 172.059C224.509 180.917 213.602 190.654 203.016 201.218C192.646 211.61 182.639 222.754 173.069 234.742C161.622 249.142 155.666 265.689 155.666 282.054C155.666 297.828 161.219 313.53 172.721 326.876C179.482 334.746 186.425 342.435 193.612 349.958C199.854 356.509 206.267 362.956 212.857 369.242C214.712 368.541 216.909 367.432 219.348 366.118L301.553 318.63C309.12 314.253 318.801 316.853 323.167 324.409C327.521 331.921 324.977 341.613 317.41 345.967L272.472 371.936ZM262.476 265.689C254.92 270.016 245.261 267.427 240.951 259.871C236.596 252.304 239.212 242.657 246.735 238.329L301.63 206.626C309.197 202.305 318.845 204.893 323.167 212.449C327.521 220.016 324.905 229.653 317.333 233.975L262.476 265.689Z" />
|
||||
|
||||
</group>
|
||||
|
||||
</vector>
|
||||
File diff suppressed because one or more lines are too long
@@ -266,66 +266,6 @@
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- Service selector: invisible to reserve space, prevents amount/remarks from shifting -->
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutServiceSelector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="invisible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/transfer_select_service"
|
||||
android:textAppearance="?attr/textAppearanceLabelMedium"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/chipGroupService"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:singleSelection="true"
|
||||
app:selectionRequired="true">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipDhiraaguReload"
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Dhiraagu Reload"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipDhiraaguBill"
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Dhiraagu Bill Pay"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipRaastas"
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Raastas"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipOoredooBill"
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Ooredoo Bill Pay"
|
||||
android:visibility="gone" />
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/spacerTo"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- One tile in the Transfer Type picker grid -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardBackgroundColor="@android:color/transparent"
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="128dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="12dp">
|
||||
|
||||
<!-- Logo, with an optional badge in the bottom corner naming the wallet it pays from.
|
||||
The badge's ring matches the dialog background (the tile itself is transparent),
|
||||
so it reads as a cut-out over the logo. -->
|
||||
<FrameLayout
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="fitCenter"
|
||||
android:importantForAccessibility="no" />
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/ivBadge"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
android:importantForAccessibility="no"
|
||||
app:contentPadding="1dp"
|
||||
app:strokeWidth="2dp"
|
||||
app:strokeColor="?attr/colorSurfaceContainerHigh"
|
||||
app:shapeAppearanceOverlay="@style/ShapeAppearance.Badge" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?attr/textAppearanceBodyMedium"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?attr/colorOnSurface" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSubtitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
@@ -261,7 +261,7 @@
|
||||
<string name="transfer_to">Account Number or Favara ID</string>
|
||||
<string name="transfer_label_from">From</string>
|
||||
<string name="transfer_label_to">To</string>
|
||||
<string name="transfer_select_service">Select Service</string>
|
||||
<string name="transfer_type_for">Transfer type for %1$s</string>
|
||||
<string name="transfer_fahipay_phone_only">Fahipay transfers require a 7-digit phone number</string>
|
||||
<string name="transfer_my_accounts">My Accounts</string>
|
||||
<string name="transfer_same_as_from">This is the same account as the sender</string>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<style name="ShapeAppearance.Circle" parent="ShapeAppearance.Material3.Corner.Full" />
|
||||
<style name="ShapeAppearance.Badge" parent="">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSize">5dp</item>
|
||||
</style>
|
||||
|
||||
<!-- Destructive confirmation dialog: centered icon/title, filled red confirm button -->
|
||||
<style name="ThemeOverlay.BasedBank.DestructiveDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog.Centered">
|
||||
|
||||
@@ -35,7 +35,40 @@ The raw "To" field input is normalised first (spaces stripped, `+960`/`960` coun
|
||||
|
||||
## Recipient Lookup
|
||||
|
||||
Lookup behaviour depends on the **source account's bank**.
|
||||
Lookup behaviour depends on the **source account's bank**, or on there being no source yet.
|
||||
|
||||
### Transfer Type picker
|
||||
|
||||
When a lookup offers exactly one transfer type, it is picked automatically and no popup is shown. When it offers more than one, a **"Transfer type for <number>"** popup opens straight away. The options are laid out as a grid of tiles, up to three per row (`item_transfer_type.xml`). Each tile shows the type's icon, its label and a subtitle (the recipient name, plus "via Fahipay" for Fahipay services). Fahipay services also show a small Fahipay logo badge on the icon's bottom corner (`TransferType.badgeRes`). Nothing is preselected, and Send stays disabled until the user picks one.
|
||||
|
||||
The popup can't be dismissed by tapping outside it or pressing back until a type has been picked. **Cancel** drops the options and brings the "To" field back for editing. Once a type is picked and the lookup offered more than one, tapping the recipient card reopens the popup to change it. Cancel then keeps the current pick.
|
||||
|
||||
Each option is a `TransferType` (`ui/home/transfer/TransferType.kt`):
|
||||
|
||||
| Type | Label | Icon | Pays from |
|
||||
|---|---|---|---|
|
||||
| `Favara(info)` | Favara Transfer | `favara_logo` | MIB or BML account |
|
||||
| `Fahipay(service, ownerName)` | the service's label, e.g. Raastas | `FahipayService.iconRes`: `ooredoo_logo` / `dhiraagu_logo` | Fahipay wallet |
|
||||
|
||||
Picking an option also picks the source (`TransferFragment.applyTransferType`). If the selected source can't pay that type, Thijooree switches it:
|
||||
|
||||
- **Favara:** the default account, if it's MIB or BML. Otherwise the source is cleared and the user is asked to pick one.
|
||||
- **Fahipay:** the user's Fahipay wallet.
|
||||
|
||||
Then the recipient card is filled in. The options, the number they were looked up for and the pick are kept in `TransferDraft`. If the view is recreated while the popup is still unanswered, it opens again.
|
||||
|
||||
The options are dropped when the "To" number is edited, the recipient is cleared, a new lookup starts or the form is cleared. If the user changes the source by hand to one that can't pay the picked type, the pick and the recipient card are dropped and the popup opens again for the same number. If that type was the only option, the recipient is cleared instead, so the user can search again with the new source.
|
||||
|
||||
### No source selected, phone number
|
||||
|
||||
Two lookups run in parallel:
|
||||
|
||||
- **Favara / IPS lookup.** Uses any logged-in MIB or BML session. The default account's bank goes first, the other is the fallback.
|
||||
- **Carrier lookup** (see Fahipay source below). Only runs when the user has a Fahipay wallet.
|
||||
|
||||
Everything that resolves is offered as a transfer type. Favara comes first, then the Fahipay services. If nothing resolves, the Favara lookup's error is shown as a toast.
|
||||
|
||||
Any other input with no source selected falls back to the default account as the source, and then the normal lookup for that bank runs.
|
||||
|
||||
### Fahipay source
|
||||
|
||||
@@ -55,7 +88,7 @@ The result maps to one or more Fahipay services:
|
||||
| Ooredoo `PRE` or `HYBRID` | Raastas (prepaid top-up) |
|
||||
| Ooredoo `POST` or `HYBRID` | Ooredoo Bill Pay |
|
||||
|
||||
If exactly one service matches, it is auto-selected. If multiple match (Ooredoo `HYBRID` gives two), a chip group is shown for the user to choose.
|
||||
The matching services are offered in the Transfer Type picker (see above).
|
||||
|
||||
### BML source
|
||||
|
||||
@@ -155,7 +188,7 @@ The dialog body text is switched based on whether the destination currency was v
|
||||
|
||||
### No source account selected
|
||||
|
||||
**Condition:** user taps the lookup button or the transfer button without selecting a "From" account.
|
||||
**Condition:** user taps the lookup button without selecting a "From" account, the input isn't a phone number, and there is no default account. For a phone number, the same toast appears when there's no MIB/BML session and no Fahipay wallet.
|
||||
|
||||
**Result:** toast: "Please select a source account first."
|
||||
|
||||
@@ -247,6 +280,7 @@ The transfer button is only enabled when all of the following are true:
|
||||
- A source account is selected
|
||||
- A recipient is resolved (`resolvedAccountNumber` not blank, or the BML handler's `qrInfo` is set)
|
||||
- Amount is greater than `0`
|
||||
- If transfer types are on offer, one has been picked
|
||||
- No connectivity error for `NO_INTERNET` or for the source bank
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user