onOffsetsChanged stops being called?

594 views
Skip to first unread message

Martin

unread,
Mar 16, 2012, 4:47:26 PM3/16/12
to GLWallpaperService
Hi,

I've started work on a wallpaper over the last few days, and I've got
to the stage where I want it to react to the user scrolling the home
screen horizontally.

I have overriden onOffsetsChanged function() in my engine class, and
that in turn calls super.onOffsetsChanged() as well as doing my own
storing of the incoming values.

However, what I'm seeing is that it gets called a few times (80 odd)
when the wallpaper starts up, but then it suddenly stops being called,
never to return. Additionally, the values never seem to change.
xOffset for example is always 0.5 regardless of which pane I'm on when
I launch the wallpaper from Eclipse, or if I'm scrolling during the
first few frames.

So it's (1) Not getting the correct values and (2) stops getting
called.

Has anybody else encountered this problem? If it's relevant I have an
HTC Desire HD, Android Version 2.3.5, HTC Sense Version 3.0. Render
mode is continuous.

So far it has me stumped. Do I need to change a setting on the base
engine class or something for it to get continuously called? I'd
appreciate any pointers on this one. Thanks!

Josh Gooderham

unread,
Mar 16, 2012, 5:12:39 PM3/16/12
to glwallpap...@googlegroups.com
Stop pulling out your hair. As I understand it, the HTC Sense UI does not implement wallpaper scrolling in their launcher. I've also heard that it has been taken out of Android proper in ICS, though I haven't been able to see that for myself.

Your code is probably fine. It's HTC's fault.

Josh
https://market.android.com/developer?pub=gentlemandroid
http://www.gentlemandroid.com/

Mark Guerra

unread,
Mar 16, 2012, 5:21:17 PM3/16/12
to glwallpap...@googlegroups.com

My guess is you could probably test Josh's theory by installing another home app, such as ADW Launcher or Launcher Pro. You could also try the emulator.

I can test the ICS scrolling on a real device once my Galaxy Nexus arrives in the mail.

Martin

unread,
Mar 17, 2012, 10:10:55 AM3/17/12
to GLWallpaperService
Okay. That's a real shame that HTC don't support it, and an even
bigger shame if Google are removing that functionality officially.
It's a neat bit of functionality.

Oh well. I might look into using a different launcher, but tbh, that
doesn't really help all the people who might download my wallpaper.
So I might just focus on non-scrolling wallpapers for the time being.

Thanks.

On Mar 16, 9:12 pm, Josh Gooderham <joshgooder...@gmail.com> wrote:
> Stop pulling out your hair. As I understand it, the HTC Sense UI does not
> implement wallpaper scrolling in their launcher. I've also heard that it
> has been taken out of Android proper in
> ICS<http://groups.google.com/group/android-developers/browse_thread/threa...>,
> though I haven't been able to see that for myself.
>
> Your code is probably fine. It's HTC's fault.
>
> Joshhttps://market.android.com/developer?pub=gentlemandroidhttp://www.gentlemandroid.com/

Josh Gooderham

unread,
Mar 17, 2012, 2:02:39 PM3/17/12
to glwallpap...@googlegroups.com

Keep in mind it will still function for everyone else. Might be hard to test yourself, but don't let a minority limit functionality.

Josh

Adam Ratana

unread,
Mar 17, 2012, 4:32:58 PM3/17/12
to glwallpap...@googlegroups.com
Hi, I've implemented this and have not run into problems on any of my devices (2.1, 3.2, 4.0.2), and it also seems to work on my Galaxy Nexus running ICS 4.0.2, though I'm using Nova Launcher which is based off of the ICS Stock launcher.  It's possible they added this back into Nova Launcher but I somehow doubt it?

I only use the xOffset value.

I've used it in this wallpaper:  https://play.google.com/store/apps/details?id=com.ratana.jazzcat.biomechanicalbogfree

See if the tree scrolls a bit in portrait mode for you.

I do second the others and highly suggest at least testing wallpapers in some of the popular launchers, especially since they let you test landscape mode rotation on a phone (some wallpapers just crash when the phone rotates...).

Martin

unread,
Mar 17, 2012, 8:26:48 PM3/17/12
to GLWallpaperService
Hi,

I've tried your wallpaper, and unfortunately the tree does not scroll
for me. It is getting the touch events for the green particles
though.

I'll have a mess around with other launchers tomorrow.

On Mar 17, 8:32 pm, Adam Ratana <adam.rat...@gmail.com> wrote:
> Hi, I've implemented this and have not run into problems on any of my
> devices (2.1, 3.2, 4.0.2), and it also seems to work on my Galaxy Nexus
> running ICS 4.0.2, though I'm using Nova Launcher which is based off of the
> ICS Stock launcher.  It's possible they added this back into Nova Launcher
> but I somehow doubt it?
>
> I only use the xOffset value.
>
> I've used it in this wallpaper:
>  https://play.google.com/store/apps/details?id=com.ratana.jazzcat.biom...

Mark Guerra

unread,
Mar 26, 2012, 10:35:30 PM3/26/12
to glwallpap...@googlegroups.com
I tested Adam's Biomechanical Bog on a Ice Cream Sandwich using the stock launcher. The home screen swiping worked as expected.

I wanted to see what data was coming in so I overrided onOffsetsChanged() in my GLEngine class. It was being called and it was passing in data to xOffset. The xOffset value for the home screens was from 0 to 1 as you scroll from left to right.

If you try to pull the screen further to the right than the rightmost screen, you do not see values that exceed 1. You also don't see values less than zero. This is all the same behavior as Gingerbread.

I tested it out for a few minutes and nothing went horribly wrong.

@Martin How did the other launchers work out?

Galaxy Nexus, Android 4.0.2, Build ICL53F
T-Mobile HTC G2, Android 2.3.4, Build 2.16.531.5 CL159515 release-keys

Martin

unread,
Mar 27, 2012, 7:43:54 AM3/27/12
to GLWallpaperService
Hi Mark,

I tried other people's wallpapers with Launcher Pro and they do indeed
scroll side to side. I will be using Launcher Pro to add and test the
onOffsetsChanged functionality for my own wallpaper.

It appears that HTC Sense 3.0 is simply broken in regards to this, and
also wallpapers freezing after previewing them. Both seem to be
entirely out of my control unfortunately, which is frustrating as I'd
rather not publish a wallpaper that has known bugs on certain
platforms.

Cheers

On Mar 27, 3:35 am, Mark Guerra <markfgue...@gmail.com> wrote:
> I tested Adam's Biomechanical Bog on a Ice Cream Sandwich using the stock
> launcher. The home screen swiping worked as expected.
>
> I wanted to see what data was coming in so I overrided onOffsetsChanged()
> in my GLEngine class. It was being called and it was passing in data to
> xOffset. The xOffset value for the home screens was from 0 to 1 as you
> scroll from left to right.
>
> If you try to pull the screen further to the right than the rightmost
> screen, you do not see values that exceed 1. You also don't see values less
> than zero. This is all the same behavior as Gingerbread.
>
> I tested it out for a few minutes and nothing went horribly wrong.
>
> @Martin How did the other launchers work out?
>
> Galaxy Nexus, Android 4.0.2, Build ICL53F
> T-Mobile HTC G2, Android 2.3.4, Build 2.16.531.5 CL159515 release-keys
>
>
>
>
>
>
>
> On Sat, Mar 17, 2012 at 8:26 PM, Martin <martinbun...@gmail.com> wrote:
> > Hi,
>
Reply all
Reply to author
Forward
0 new messages