开发者

"fixing" a live wallpaper in portrait mode

开发者 https://www.devze.com 2023-03-23 10:44 出处:网络
I\'m trying to find the \"simplest\" way to fix my live wallpaper in portrait mode, and, as for now, the only way I found is to rotate the entire canvas by 90 degrees counter-clockwise and shift it \"

I'm trying to find the "simplest" way to fix my live wallpaper in portrait mode, and, as for now, the only way I found is to rotate the entire canvas by 90 degrees counter-clockwise and shift it "down" by the screen width size when the device is in landscape mode. But this solution doesn't work very well, a开发者_开发知识库nd I think that's inneficient (cause I have a lot of bitmaps in different positions).

Did anyone find a simpler and efficient solution to artificially fix a live wallpaper in just one orientation mode?


If you take a look at the example google gives, there's an onSurfacedChanged() Method that handles screen rotations. I haven't tested it out yet, but if you don't make any calls there, I think the surface will not change.

http://developer.android.com/resources/samples/CubeLiveWallpaper/src/com/example/android/livecubes/cube1/CubeWallpaper1.html

0

精彩评论

暂无评论...
验证码 换一张
取 消