sdkers / floatwindow Goto Github PK
View Code? Open in Web Editor NEWandroid悬浮窗
License: Apache License 2.0
android悬浮窗
License: Apache License 2.0
隐藏了悬浮窗之后,将APP后台后再打开,悬浮窗自动显示了
帮忙看看这个问题
有时候 悬浮窗 不显示,需要按一下睡眠键,屏幕变暗后,悬浮窗就冒出来了。很奇葩。发生的概率是30%-40%。还挺高。
..希望能修复这个问题.现在我也是监听前后台来进行hide/show...
代码如下,如果设置setDesktopShow(false)就会出现题目问题..
机型:华为荣耀
val floatView= ImageView(applicationContext)
floatView.setImageResource(R.mipmap.floatview)
FloatWindow.with(applicationContext)
.setView(floatView)
.setDesktopShow(false)
.setMoveType(MoveType.SLIDE)
.setX(Screen.WIDTH,0.8f)
.setY(Screen.HEIGHT,0.8f)
.build()
Error: Program type already present: android.support.v4.media.MediaBrowserCompat$ItemCallback
implementation ("com.github.SDKers:FloatWindow:1.0.9") {
exclude group: 'com.android.support', module: 'support-v4'
}
这样也不行
已经初始化过了,每次调用FloatWindow.destroy()都会报错。
多次尝试后发现,如果之前调用过FloatWindow.show(),就不会再报错了。
请问这个问题怎么解决?
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3706)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3724)
at android.app.ActivityThread.access$1400(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.IllegalArgumentException: View=android.widget.FrameLayout{29cecb49 V.E..... ......ID 0,0-0,0} not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:396)
at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:322)
at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:111)
at com.yhao.floatwindow.impl.FloatPhone.dismiss(FloatPhone.java:129)
at com.yhao.floatwindow.impl.IFloatWindowImpl.dismiss(IFloatWindowImpl.java:136)
at com.yhao.floatwindow.FloatWindow.destroy(FloatWindow.java:69)
at com.yhao.floatwindow.FloatWindow.destroy(FloatWindow.java:57)
at com.bestsch.classboard.mvp.ui.activity.MainActivity.onDestroy(MainActivity.java:388)
at android.app.Activity.performDestroy(Activity.java:6169)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1141)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3693)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3724)
at android.app.ActivityThread.access$1400(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
改了半天,才运行起来,很多都是老的东西,可以把无用的删除,用gradle统一管理
MIUI2 Android9
主要是那些app有个开屏广告,全屏的时候。
设置桌面展示为False 但是在切换页面的时候会出现一下就隐藏了 不太清为什么。
比如我页面顶部一个toolbar,底部也有一个toolbar,只想要这个悬浮按钮在这两个toolbar中间区域拖动,该如何实现呢?
1.从竖屏到横屏,悬浮窗位置没有按照宽高比展示,导致竖屏如果悬浮窗在下面,切换横屏就显示不出来了。
2.切换横屏后,悬浮窗拖动区域没改变,还是竖屏的区域。
我真是头大,只要是科大讯飞的初始化放在悬浮窗show()之前,就会anr 头大大大大大大大大
经常显示着的时候,回到主页面,一段时间后就自动消失了,看了日志,没有错误日志,不知道是什么原因,我是不断读取本地文件并更新view,时间间隔1s、2s、都有这种现象
1.如果悬浮窗位置在右下角,此时从竖屏到横屏,悬浮窗就不见了
2.切换横屏后,边界不正确,悬浮窗无法对右侧贴边,无法拖动到右侧区域
老哥,不知为何会出现错乱的横竖屏切换;我切换为原作者的版本就好了。
悬浮窗贴边view改变样式怎么实现
MoveType.slide 这个往上和往下拉,可以消失不见了,这个怎么解决呀
全面屏 返回桌面 如何隐藏悬浮窗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.