AlynxZhou / alynx-live-wallpaper

An android app that allows you choose a video as wallpaper.
https://livewallpaper.alynx.xyz/
Apache License 2.0
94 stars 37 forks source link

Bug: yOffset is set based on maxYOffset #23

Open AndroidDeveloperLB opened 1 year ago

AndroidDeveloperLB commented 1 year ago

This:

if (yOffset < -maxXOffset) {

https://github.com/AlynxZhou/alynx-live-wallpaper/blob/master/app/src/main/java/xyz/alynx/livewallpaper/GLES30WallpaperRenderer.java#L303C9-L303C37

https://github.com/AlynxZhou/alynx-live-wallpaper/blob/master/app/src/main/java/xyz/alynx/livewallpaper/GLES20WallpaperRenderer.java#L301C24-L301C34

AlynxZhou commented 1 year ago

Yes, I'll fix it soon..

AndroidDeveloperLB commented 1 year ago

Thing is, I thought this was the reason for this issue: https://github.com/AlynxZhou/alynx-live-wallpaper/issues/21 On the way I've also noticed that the range of y-offset could be weird, because the minimal value can be larger than the maximal value.

I thought about it more, and I still don't understand what causes it. I have found out though, that there is a possible issue of multi-threads, because the live wallpaper service is usually working on UI thread, yet the drawing part of OpenGL is always on a background thread. You should have some protection between the two. Check on each function if it's on UI thread or not, add annotations of "UiThread" and "WorkerThread" to help you figure out when such issues happen.

If you wish, I've prepared a forked version of this repository, and converted all into Kotlin: https://github.com/AndroidDeveloperLB/alynx-live-wallpaper I did it because I thought this repository isn't going to be updated anymore.

And I was so concerned about the scrolling that I've asked how to fix it on StackOverflow, including trying to prepare a POC just for this purpose alone: https://stackoverflow.com/q/76608433/878126

I also tried to contact you and offer to donate to encourage you to fix all issues