Fix lockscreen wallpaper preview in CategoryFragment shows static thumbnail for live wallpapers.

Add more conditions to decide if it should show live wallpaper or not.

Video: https://drive.google.com/file/d/10pL4_sx4mzE_5UUmp366WKrTaTucfeaF/view?usp=sharing

Bug: 158477683
Change-Id: I9e263c52804c2dec13628bc092b3cdc2ebe84eda
diff --git a/src/com/android/wallpaper/picker/CategoryFragment.java b/src/com/android/wallpaper/picker/CategoryFragment.java
index 51c4a07..cfb693e 100755
--- a/src/com/android/wallpaper/picker/CategoryFragment.java
+++ b/src/com/android/wallpaper/picker/CategoryFragment.java
@@ -189,7 +189,8 @@
                 // For live wallpaper, show its thumbnail when scrolling.
                 if (mWallpaperConnection != null && mWallpaperConnection.isEngineReady()
                         && mHomePreviewWallpaperInfo instanceof LiveWallpaperInfo) {
-                    if (positionOffset == 0.0f) {
+                    if (positionOffset == 0.0f || positionOffset == 1.0f
+                            || positionOffsetPixels == 0) {
                         // The page is not moved. Show live wallpaper.
                         mWallpaperSurface.setZOrderMediaOverlay(false);
                     } else {
@@ -200,7 +201,8 @@
 
                 if (mWallpaperConnection != null && mWallpaperConnection.isEngineReady()
                         && mLockPreviewWallpaperInfo instanceof LiveWallpaperInfo) {
-                    if (positionOffset == 0.0f) {
+                    if (positionOffset == 0.0f || positionOffset == 1.0f
+                            || positionOffsetPixels == 0) {
                         // The page is not moved. Show live wallpaper.
                         LiveTileOverlay.INSTANCE.attach(mLockscreenPreview.getOverlay());
                     } else {