|
|
@@ -15,8 +15,10 @@ import com.grkj.ui_base.utils.event.RFIDCardReadEvent
|
|
|
import com.grkj.ui_base.utils.extension.tip
|
|
|
import com.kongzue.dialogx.dialogs.CustomDialog
|
|
|
import com.kongzue.dialogx.dialogs.PopTip
|
|
|
+import com.kongzue.dialogx.interfaces.DialogLifecycleCallback
|
|
|
import com.kongzue.dialogx.interfaces.OnBindView
|
|
|
import com.sik.sikcore.extension.setDebouncedClickListener
|
|
|
+import org.greenrobot.eventbus.EventBus
|
|
|
import org.greenrobot.eventbus.Subscribe
|
|
|
import org.greenrobot.eventbus.ThreadMode
|
|
|
|
|
|
@@ -38,7 +40,17 @@ class UpdateCardDialog(
|
|
|
binding = DialogUpdateCardBinding.bind(v)
|
|
|
dialog?.isCancelable = false
|
|
|
dialog?.setMaskColor(CommonUtils.getColor(com.grkj.ui_base.R.color.scrim))
|
|
|
-
|
|
|
+ if (!EventBus.getDefault().isRegistered(this)) {
|
|
|
+ EventBus.getDefault().register(this)
|
|
|
+ }
|
|
|
+ dialog?.setDialogLifecycleCallback(object : DialogLifecycleCallback<CustomDialog>() {
|
|
|
+ override fun onDismiss(dialog: CustomDialog?) {
|
|
|
+ super.onDismiss(dialog)
|
|
|
+ if (EventBus.getDefault().isRegistered(this)) {
|
|
|
+ EventBus.getDefault().unregister(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
// 预填数据
|
|
|
binding.cardNfcEt.setText(card.cardNfc)
|
|
|
selectedUser = userData.find { it.getId() == card.userId }
|