Loading toruslib/torus-core/src/main/java/com/google/android/torus/core/wallpaper/LiveWallpaper.kt +11 −0 Original line number Diff line number Diff line Loading @@ -434,6 +434,17 @@ abstract class LiveWallpaper : WallpaperService() { return super.onCommand(action, x, y, z, extras, resultRequested) } override fun onAmbientModeChanged(inAmbientMode: Boolean, animationDuration: Long) { super.onAmbientModeChanged(inAmbientMode, animationDuration) if (wallpaperEngine is LiveWallpaperEventListener) { (wallpaperEngine as LiveWallpaperEventListener).onAmbientModeChanged( inAmbientMode, animationDuration, ) } } override fun onTouchEvent(event: MotionEvent) { super.onTouchEvent(event) Loading toruslib/torus-core/src/main/java/com/google/android/torus/core/wallpaper/listener/LiveWallpaperEventListener.kt +4 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.google.android.torus.core.wallpaper.listener import android.app.WallpaperColors import android.os.Bundle import android.service.wallpaper.WallpaperService /** * Interface that is used to implement specific wallpaper callbacks like offset change (user swipes Loading Loading @@ -101,6 +102,9 @@ interface LiveWallpaperEventListener { */ fun onSleep(extras: Bundle) /** @see WallpaperService.Engine.onAmbientModeChanged */ fun onAmbientModeChanged(inAmbientMode: Boolean, animationDuration: Long) {} /** * Indicates whether the zoom animation should be handled in WindowManager. Preferred to be set * to true to avoid pressuring GPU. Loading Loading
toruslib/torus-core/src/main/java/com/google/android/torus/core/wallpaper/LiveWallpaper.kt +11 −0 Original line number Diff line number Diff line Loading @@ -434,6 +434,17 @@ abstract class LiveWallpaper : WallpaperService() { return super.onCommand(action, x, y, z, extras, resultRequested) } override fun onAmbientModeChanged(inAmbientMode: Boolean, animationDuration: Long) { super.onAmbientModeChanged(inAmbientMode, animationDuration) if (wallpaperEngine is LiveWallpaperEventListener) { (wallpaperEngine as LiveWallpaperEventListener).onAmbientModeChanged( inAmbientMode, animationDuration, ) } } override fun onTouchEvent(event: MotionEvent) { super.onTouchEvent(event) Loading
toruslib/torus-core/src/main/java/com/google/android/torus/core/wallpaper/listener/LiveWallpaperEventListener.kt +4 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.google.android.torus.core.wallpaper.listener import android.app.WallpaperColors import android.os.Bundle import android.service.wallpaper.WallpaperService /** * Interface that is used to implement specific wallpaper callbacks like offset change (user swipes Loading Loading @@ -101,6 +102,9 @@ interface LiveWallpaperEventListener { */ fun onSleep(extras: Bundle) /** @see WallpaperService.Engine.onAmbientModeChanged */ fun onAmbientModeChanged(inAmbientMode: Boolean, animationDuration: Long) {} /** * Indicates whether the zoom animation should be handled in WindowManager. Preferred to be set * to true to avoid pressuring GPU. Loading