Android live wallpaper fade effect

牧云@^-^@ 提交于 2020-01-01 14:23:43

问题


I would like to ask about fade and slide effect in live wallpaper. How can I make fade in/ fade out or slide in/ slide out effect in live wallpaper when change between two images. If someone knows, please help me!

Thanks for reading!


回答1:


With live wallpaper, you must handle these effects manually. Fade in/fade out could be achieved by drawing two bitmaps into the same canvas and varying the alpha of the second bitmap. I'm not sure what you mean by "slide" ... live wallpapers usually use an effect called parallax scrolling, which is facilitated by the onOffsetsChanged() callback...see the cube example in the SDK for a simple implementation.



来源:https://stackoverflow.com/questions/6338412/android-live-wallpaper-fade-effect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!