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

FloatingWindowHelper中设置config.layoutView和config.layoutId处理逻辑不一致,导致在使用setFilter时需要手动显示view #228

Open
WzhiHuan opened this issue Apr 6, 2023 · 0 comments

Comments

@WzhiHuan
Copy link

WzhiHuan commented Apr 6, 2023

2.0.4版本中
FloatingWindowHelper此类中第119行-125行如下

frameLayout = ParentFrameLayout(rootViewContext, config)
frameLayout?.tag = config.floatTag
// 将浮窗布局文件添加到父容器frameLayout中,并返回该浮窗文件
val floatingView = config.layoutView?.also { frameLayout?.addView(it) }
?: LayoutInflater.from(context).inflate(config.layoutId!!, frameLayout, true)
// 为了避免创建的时候闪一下,我们先隐藏视图,不能直接设置GONE,否则定位会出现问题
floatingView.visibility = View.INVISIBLE

config.layoutView不为空的情况下 floatingView 为外部自定义view
config.layoutId不为空的情况下 floatingView 为内部ParentFrameLayout

125行中config.layoutView被设为不可见的情况,会导致setFilter()在隐藏悬浮窗后,即时切到可显示悬浮窗的页面也仍然不显示,需要手动在OnFloatCallbacks的show回调方法中设置为可见

希望版本升级后,config.layoutView和config.layoutId能保持一致

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

1 participant