I am currently working on a Live Wallpaper in Android.
It turned out the Samsung's TouchWiz launcher never calls the onOffsetChanged
method. The only way here is to detect if TouchWiz is running and to simulate the scrolling accordingly.
Is there a way to detect if my Live Wallpaper is running under Samsung's TouchWiz launcher?
TouchWiz launcher detection
1.1k views Asked by ezpresso At
2
There are 2 answers
0
On
Don't try to detect the launcher, as HTC does this on some devices as well.
Better solution is to assume you WON'T get scroll events, and ALWAYS initially do your simulated scrolling. Then, if you get a call to onOffsetChanged
(which will happen with most launchers), disable your simulated scrolling and carry on as normal.
You can detect if a Launcher is Installed using the following code provided in the examples below;
First One
Second One
However your best option wil be to always simulate scrolling, because there are more Launchers that don't trigger
OnOffsetsChanged
. But when you actually get a call toOnOffsetsChanged
just disable simulated scrolling. This wayOnOffsetsChanged
can function normally if it's available.The following article will give you an idea of how to approach this; Artikel Link