有什么方法可以隐藏 Android 主屏幕图标以显示动态壁纸?
随着Android动态壁纸变得越来越流行,开发人员也越来越多地利用它们,越来越多的问题出现了:如何在用户与壁纸交互时暂时隐藏主屏幕图标。
为此,必须暂时删除图标 - 而不仅仅是使其不可见,因为点击不可见的图标仍会运行该应用程序。
此外,最好有一个能够跨自定义启动器(而不仅仅是 Android 原生启动器)运行的通用解决方案。
这个问题已经在 StackOverflow 上被问过,答案是您不能这样做。但这显然是不正确的,因为 Android Market 上至少有两个程序可以做到这一点: 炫耀(您的动态壁纸) 和 清洁器(显示壁纸)
有办法吗隐藏 Android 主屏幕图标,然后将它们放回原处?
As Android live wallpapers are becoming more prevalent, and developers are doing more with them, a question coming up more and more is how to hide the home screen icons temporarily while the user interacts with the wallpaper.
For this to work, the icons would have to be removed temporarily – not just made invisible, since a tap on an invisible icon would still run the app.
Also, it would be ideal to have a universal solution that works across customs launchers, not just the Android stock launcher.
This question was already asked on StackOverflow, and the answer was that you cannot do this. But this is clearly not correct, as there are at least two programs on Android Market that do exactly this: Show Off (Your Live Wallpaper) and The Cleaner (Show Wallpaper)
Is there a way to hide Android home screen icons, and then later put them back in place?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以启动一个活动,其背景将是您的实时壁纸,并在触摸后完成活动...只是一个想法...
编辑:
第1条评论回复:
防止延迟:
您应该在 onCreate() 方法中更加“温和”...
尝试在 onCreate() 中创建尽可能小的值,例如,仅显示基本背景...
在onCreate函数的末尾,设置一个闹钟(即通过AlarmManager)在半秒左右(使用AlarmManager)后调用一些BroadcastReceiver/Activity来设置其余的动态壁纸图形...这样你就不会不得不担心延误。
You can launch an activty which backgroung will be your live walpaper, and finish the activty upon touch... Just a thought...
Edit:
1st comment answer:
Preventing the delay:
You should be more "gentle" in the onCreate() method...
Try creating the minimum as possible in the onCreate(), like, just displaying the basic background...
in the end of the onCreate function, set an alarm (i.e. by AlarmManager) to call some BroadcastReceiver/Activity after half a second or so (with AlarmManager) to set the rest of the live wallpaper graphics... that way you don't have to worry about the delay.
这必须是一个全新的启动器。我认为如果没有这个,这是不可能的。对不起。然而;为了绝对确定,您必须查看 Android 源代码中的 Launcher2 包并查看 Homescreen.java 等文件。我稍后会在 2.3.3 上为您研究一下,看看我发现了什么。
This would have to be a completely new launcher. This is not possible without this I don't think. Sorry. However; to be absolutely sure though you'd have to look at the Launcher2 package in the android source and look through files like Homescreen.java. I'll look into it later on 2.3.3 for you and see what I find.
尝试像放大网页一样使用缩放手势(反向捏合)。你猜对了,相反的事情会让一切回归原样。
Try using the zoom gesture as you would to zoom in on a web page (reverse pinch). And you guessed it, the opposite makes everything come back.