Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TipDialog、WaitDialog弹框外背景 #224

Open
QIMOU opened this issue Dec 23, 2020 · 5 comments
Open

TipDialog、WaitDialog弹框外背景 #224

QIMOU opened this issue Dec 23, 2020 · 5 comments

Comments

@QIMOU
Copy link

QIMOU commented Dec 23, 2020

大佬,能否加一个可以设置TipDialog、WaitDialog弹框外背景透明度的属性,有时候接口响应很快,屏幕会进行 白-灰-白 切换,有些闪

@kongzue
Copy link
Owner

kongzue commented Dec 24, 2020

这个原因本质上是Dialog自身的问题,DialogV3基于Android提供的DialogFragment实现,其自身实现DialogFragment背景逻辑,这并不是DialogV3所控制的,我更推荐您尝试DialogX库,因为实现原理不同,不会存在此问题

@QIMOU
Copy link
Author

QIMOU commented Dec 25, 2020

ok,刚看了DialogX [牛牛牛牛牛牛牛牛牛批!!!],现在项目不好改了,下个项目我会试试DialogX。感谢,辛苦了,respect!

@kongzue
Copy link
Owner

kongzue commented Dec 25, 2020

可以通过自定义style实现,相关方法为DialogSettings.systemDialogStyle=R.style.CustomStyle,需要你在res/xml/styles.xml中编写一个Style:

<style name="CustomStyle" parent="BaseDialog">
    <item name="android:backgroundDimAmount">0</item>
</style>

上述是全局的,如果你需要单独只设置TipDialog和WaitDialog,建议封装个启动方法,然后用以下方式启动:

WaitDialog.build(activityContext)
        .setCustomDialogStyleId(R.style.CustomStyle)
        .setMessage("测试")
        .show();

@QIMOU
Copy link
Author

QIMOU commented Jan 4, 2021

多谢大佬

@df13954
Copy link

df13954 commented Jan 27, 2021

可以通过自定义style实现,相关方法为DialogSettings.systemDialogStyle=R.style.CustomStyle,需要你在res/xml/styles.xml中编写一个Style:

<style name="CustomStyle" parent="BaseDialog">
    <item name="android:backgroundDimAmount">0</item>
</style>

上述是全局的,如果你需要单独只设置TipDialog和WaitDialog,建议封装个启动方法,然后用以下方式启动:

WaitDialog.build(activityContext)
        .setCustomDialogStyleId(R.style.CustomStyle)
        .setMessage("测试")
        .show();

这个功能很实用,建议写在文档中,让更多的知道。在使用v2的时候遇到这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants