kongzue / DialogX

💬 DialogX dialog box component library, easy to use, more customizable, more scalable, easy to achieve a variety of dialog boxes. DialogX对话框组件库,更加方便易用,可自定义程度更高,扩展性更强,轻松实现各种对话框、菜单和提示效果,更有Material You、iOS、MIUI等主题扩展可选
Apache License 2.0
2.09k stars 218 forks source link

BottomDialog,设置背景遮罩,界面会先闪一下 #207

Closed aggbinbin closed 2 years ago

aggbinbin commented 2 years ago

BUG 反馈

请先确认您已阅读《常见问题》

问题描述:

使用底部对话框 BottomDialog,且自定义View布局时,setMaskColor设置背景遮罩背景会先闪一下。 注:放在dialog的show之前和show之后调用都会闪

源码使用如下: ` fun showSubscribe( name: String, isChecked: Boolean, selectCallback: SelectCallback ) { BottomDialog.build().setCustomView(object : OnBindView(R.layout.dialog_bottom_subscribe_notification) { override fun onBind(dialog: BottomDialog, v: View) { // 去掉默认滑动提示条 if (dialog.dialogImpl.imgTab != null) { (dialog.dialogImpl.imgTab.parent as ViewGroup).removeView(dialog.dialogImpl.imgTab) }

            val notificationDesc = v.findViewById<CustomStrokeTextView>(R.id.notificationDesc)
            notificationDesc.text = String.format(
                ApplicationUtils.getApplication().getString(R.string.a_notification_desc), name
            )

            val notificationSwitch = v.findViewById<SwitchCompat>(R.id.notificationSwitch)
            notificationSwitch.isChecked = isChecked
            notificationSwitch.setOnCheckedChangeListener { _, isChecked ->
                selectCallback.onCall(isChecked, notificationSwitch)
            }
        }
    }).setBackgroundColorRes(R.color.color_272727).setMaskColor(Color.parseColor("#99000000")).show()
}

`

设备信息:

SM-N9700(Galaxy Note10) AAR版本:com.github.kongzue.DialogX:DialogX:0.0.43

是否在 Demo 中能复现此问题?

问题截图/视频

Screenshot_20220614_151337

https://user-images.githubusercontent.com/105193984/173516033-35c38c4c-c441-482c-a6b9-0398b92f054c.mp4

kongzue commented 2 years ago

Mark,正在尝试复现问题...

kongzue commented 2 years ago

请更新至0.0.45.beta18版本已修复此问题。

aggbinbin commented 2 years ago

经验证,此问题在0.0.45.beta18版本已修复,感谢作者第一时间解答,谢谢