动态壁纸isVisible/onVisibilityChanged不适用于Android 9+应用程序抽屉 [英] Live Wallpaper isVisible/onVisibilityChanged not working with Android 9+ App drawer

查看:257
本文介绍了动态壁纸isVisible/onVisibilityChanged不适用于Android 9+应用程序抽屉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我观察到 isVisible() 和/或 onVisibilityChanged() 未报告可见性更改Android 9手机上的AppsDrawer可以覆盖动态壁纸.我猜这是因为Apps Drawer显示为半透明,因为您可以看到下面显示的LWP提示.

I have observed No visibility change reported by the isVisible() and/or onVisibilityChanged() when a Live Wallpaper is covered by AppsDrawer on an Android 9 phone. I am guessing it's because the Apps Drawer is shown translucent, as you can make out a hint of LWP shown underneath.

原因是我需要能够确定AppsDrawer何时遮盖了我的LWP,就像文档所说的那样 非常重要的是,墙纸只能在可见时使用CPU . https://developer.android.com/reference/android/service/墙纸/WallpaperService.Engine

Reason I need to be able to determine when AppsDrawer obscures my LWP is, just as the doc says It is very important that a wallpaper only use CPU while it is visible.. https://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine

是否存在一些替代方法来确定可见性或焦点变更?不确定LWP是否真的可以成为焦点

Is there some alternative ways to work out visibility or focus change? not sure LWP really gets a focus

推荐答案

这可以按预期工作:如果动态壁纸对用户完全可见(即使在启动器的下面),也将被视为可见.

This is working as intended: if the live wallpaper is at all visible to the user (even under layers of the launcher), it will be considered visible.

动态壁纸没有回调可知道应用程序抽屉是否大部分遮盖了动态壁纸(并且不同的启动器可能会少得多或更多地遮盖住它).

There's no callback for a live wallpaper to know if the app drawer is mostly obscuring the live wallpaper (and different launchers may obscure it much less or much more).

这篇关于动态壁纸isVisible/onVisibilityChanged不适用于Android 9+应用程序抽屉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆