Updated on 2026-08-14
This commit is contained in:
parent
5eb2c2e91f
commit
146bbc6767
3 changed files with 0 additions and 49 deletions
|
|
@ -168,10 +168,6 @@ data class WalletState(
|
|||
}
|
||||
|
||||
sealed class WalletDialog : StateDialog {
|
||||
data class QrDialog(
|
||||
val qrCode: Bitmap?, val shareUrl: String?, val currencyName: CryptoCurrencyName?
|
||||
) : WalletDialog()
|
||||
|
||||
data class SelectAmountToSendDialog(val amounts: List<Amount>?) : WalletDialog()
|
||||
object SignedHashesMultiWalletDialog : WalletDialog()
|
||||
object ChooseTradeActionDialog : WalletDialog()
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
package com.tangem.tap.features.wallet.ui.dialogs
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import com.tangem.tap.common.extensions.hide
|
||||
import com.tangem.tap.common.extensions.show
|
||||
import com.tangem.tap.common.redux.global.CryptoCurrencyName
|
||||
import com.tangem.tap.features.wallet.redux.WalletAction
|
||||
import com.tangem.tap.store
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.dialog_qrcode.*
|
||||
|
||||
class QrDialog(context: Context) : Dialog(context) {
|
||||
|
||||
init {
|
||||
this.setContentView(R.layout.dialog_qrcode)
|
||||
}
|
||||
|
||||
fun showQr(qrCode: Bitmap, shareUrl: String, currencyName: CryptoCurrencyName?) {
|
||||
this.setOnDismissListener { store.dispatch(WalletAction.HideDialog) }
|
||||
this.btn_done?.setOnClickListener { store.dispatch(WalletAction.HideDialog) }
|
||||
|
||||
this.tv_qr_dialog_address?.text = shareUrl
|
||||
this.iv_qrcode?.setImageBitmap(qrCode)
|
||||
if (currencyName == null) {
|
||||
this.tv_qr_dialog_header.hide()
|
||||
} else {
|
||||
this.tv_qr_dialog_header.show()
|
||||
this.tv_qr_dialog_header.text = context.getString(
|
||||
R.string.wallet_qr_title_format, currencyName
|
||||
)
|
||||
}
|
||||
super.show()
|
||||
}
|
||||
}
|
||||
|
|
@ -244,15 +244,6 @@ class SingleWalletView : WalletView {
|
|||
private fun handleDialogs(walletDialog: StateDialog?, fragment: WalletFragment) {
|
||||
val context = fragment.context ?: return
|
||||
when (walletDialog) {
|
||||
is WalletDialog.QrDialog -> {
|
||||
if (walletDialog.qrCode != null && walletDialog.shareUrl != null) {
|
||||
if (dialog == null) dialog = QrDialog(context).apply {
|
||||
this.showQr(
|
||||
walletDialog.qrCode, walletDialog.shareUrl, walletDialog.currencyName
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
is WalletDialog.SelectAmountToSendDialog -> {
|
||||
if (dialog == null) dialog = AmountToSendDialog(context).apply {
|
||||
this.show(walletDialog.amounts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue