Fix bug: transfer source drop down automatically closing to update profile image

This commit is contained in:
2026-05-27 22:40:05 +05:00
parent 3e8ea90701
commit c4ad35e6b9
@@ -1646,10 +1646,12 @@ class TransferFragment : Fragment() {
acc.bank == "MIB" -> { acc.bank == "MIB" -> {
val hash = acc.profileImageHash val hash = acc.profileImageHash
val cached = hash?.let { dropdownProfileImageCache[it] } val cached = hash?.let { dropdownProfileImageCache[it] }
val imageView = b.ivDropdownCardLogo
imageView.tag = hash
if (cached != null) { if (cached != null) {
b.ivDropdownCardLogo.setImageBitmap(cached) imageView.setImageBitmap(cached)
} else { } else {
b.ivDropdownCardLogo.setImageResource(R.drawable.mib_logo) imageView.setImageResource(R.drawable.mib_logo)
if (hash != null) { if (hash != null) {
val app = requireActivity().application as BasedBankApp val app = requireActivity().application as BasedBankApp
viewLifecycleOwner.lifecycleScope.launch { viewLifecycleOwner.lifecycleScope.launch {
@@ -1663,12 +1665,12 @@ class TransferFragment : Fragment() {
} }
if (bitmap != null) { if (bitmap != null) {
dropdownProfileImageCache[hash] = bitmap dropdownProfileImageCache[hash] = bitmap
accountDropdownAdapter?.notifyDataSetChanged() if (imageView.tag == hash) imageView.setImageBitmap(bitmap)
} }
} }
} }
} }
b.ivDropdownCardLogo.visibility = View.VISIBLE imageView.visibility = View.VISIBLE
} }
else -> b.ivDropdownCardLogo.visibility = View.GONE else -> b.ivDropdownCardLogo.visibility = View.GONE
} }