[英]Implementing a live wallpaper
I'm making a custom home screen, and I would like to give the user the ability to use live wallpapers in my launcher/home screen. 我正在制作自定义主屏幕,我希望使用户能够在启动器/主屏幕中使用动态壁纸。 Settings android:Theme.Holo.Wallpaper.NoTitleBar
as my AppTheme
kind of what I want, but not exactly. 设置android:Theme.Holo.Wallpaper.NoTitleBar
作为我AppTheme
那种我想要的,但不完全是。
There are 2 possible solutions (but please tell me if you can think of another good one); 有两种可能的解决方案(但是请告诉我您是否可以想到另一个好的解决方案);
android:Theme.Holo.Wallpaper.NoTitleBar
as my AppTheme
使用android:Theme.Holo.Wallpaper.NoTitleBar
作为我的AppTheme
Whichever approach I take, these are 2 problems I'd incur either way and would also like a solution to; 无论我采用哪种方法,这都是我将要遇到的两个问题,并且也希望找到解决方案;
Here's what I ended up doing; 这就是我最终要做的事情;
android:Theme.Holo.Wallpaper.NoTitleBar
as the AppTheme
. 将android:Theme.Holo.Wallpaper.NoTitleBar
设置为AppTheme
。 WallpaperManager.getInstance (this.context).getWallpaperInfo () != null
to detect whether a live wallpaper is set. 使用WallpaperManager.getInstance (this.context).getWallpaperInfo () != null
来检测是否设置了动态壁纸。 Apparently using android:Theme.Holo.Wallpaper.NoTitleBar
does not stop the user from interacting with the live wallpaper. 显然,使用android:Theme.Holo.Wallpaper.NoTitleBar
不停止从与动态壁纸交互的用户。 The live wallpapers I tested with (the default ones that come with Android) just didn't allow any kind of interaction, which I didn't realise. 我测试过的动态壁纸(Android附带的默认壁纸)只是不允许进行任何互动,而我却没有意识到。
I hope this information is able to save someone else some time. 我希望这些信息能够节省一些时间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.