Friday, December 31, 2010

[android-developers] Re: Virtual screen size

Let me develop on this subject:

I've develop a Live Wallpaper that was working perfectly in Android 2.1. It emulate the standard Android wallpaper by having a bitmap scrolling when a user changes screen.

To achieve that effect I use the event "onOffsetsChanged" to detect screen changes when the user swipes left and right.

I just installed Android 2.2.1 and now the values returned in onOffsetsChanged for xPixelOffset and yPixelOffset are always 0. The value for xOffset and yOffset do return values from 0 to 1 but because WallpaperManager.getInstance(myContext).getDesiredMinimumHeight() and WallpaperManager.getInstance(myContext).getDesiredMinimumHeight() now return the screen physical size instead of the screen virtual size, I have now way to calculate how much that percentage represent in terms of actual displacement.

I know it's possible to achieve the desired result because the packed wallpaper has that behaviour.

Can somebody help? Is this a problem with Samsung Galaxy S implementation or is this a standard behaviour?

Thanks,
Pedro Duque

On 1 January 2011 02:05, Pedro Duque <pmduque@gmail.com> wrote:

When developing a live wallpaper how can I get the virtual screen size? How can I know in which virtual screen the user is in?

Thanks,
PMD


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment