-
public class AndroidLiveWallpaperService.AndroidWallpaperEngine extends WallpaperService.Engine
Bridge between surface on which wallpaper is rendered and the wallpaper service. The problem is that there can be a groupof Engines at one time and we must share libGDX application between them.
-
-
Constructor Summary
Constructors Constructor Description AndroidLiveWallpaperService.AndroidWallpaperEngine()
-
Method Summary
Modifier and Type Method Description voidonCreate(SurfaceHolder surfaceHolder)voidonSurfaceCreated(SurfaceHolder holder)Called before surface holder callbacks (ex for GLSurfaceView)! voidonSurfaceChanged(SurfaceHolder holder, int format, int width, int height)This is called immediately after any structural changes (format or size) have been made to the surface. voidonVisibilityChanged(boolean visible)Called to inform you of the wallpaper becoming visible or hidden. voidonResume()voidonPause()voidonSurfaceDestroyed(SurfaceHolder holder)Called after surface holder callbacks (ex for GLSurfaceView)! voidonDestroy()BundleonCommand(String pAction, int pX, int pY, int pZ, Bundle pExtras, boolean pResultRequested)voidonTouchEvent(MotionEvent event)voidonOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset)WallpaperColorsonComputeColors()-
Methods inherited from class android.service.wallpaper.WallpaperService.Engine
getDesiredMinimumHeight, getDesiredMinimumWidth, getDisplayContext, getSurfaceHolder, getWallpaperFlags, isPreview, isVisible, notifyColorsChanged, onApplyWindowInsets, onCommand, onComputeColors, onCreate, onDesiredSizeChanged, onDestroy, onOffsetsChanged, onSurfaceChanged, onSurfaceCreated, onSurfaceDestroyed, onSurfaceRedrawNeeded, onTouchEvent, onVisibilityChanged, onWallpaperFlagsChanged, onZoomChanged, setOffsetNotificationsEnabled, setTouchEventsEnabled -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onCreate
void onCreate(SurfaceHolder surfaceHolder)
-
onSurfaceCreated
void onSurfaceCreated(SurfaceHolder holder)
Called before surface holder callbacks (ex for GLSurfaceView)! This is called immediately after the surface is firstcreated. Implementations of this should start up whatever rendering code they desire. Note that only one thread can everdraw into a Surface, so you should not draw into the Surface here if your normal rendering will be in another thread.
-
onSurfaceChanged
void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height)
This is called immediately after any structural changes (format or size) have been made to the surface. You should atthis point update the imagery in the surface. This method is always called at least once, aftersurfaceCreated(SurfaceHolder).
-
onVisibilityChanged
void onVisibilityChanged(boolean visible)
Called to inform you of the wallpaper becoming visible or hidden. It is very important that a wallpaper only use CPUwhile it is visible..
-
onResume
void onResume()
-
onPause
void onPause()
-
onSurfaceDestroyed
void onSurfaceDestroyed(SurfaceHolder holder)
Called after surface holder callbacks (ex for GLSurfaceView)! This is called immediately before a surface is beingdestroyed. After returning from this call, you should no longer try to access this surface. If you have a renderingthread that directly accesses the surface, you must ensure that thread is no longer touching the Surface before returningfrom this function.Attention! In some cases GL context may be shutdown right now! and SurfaceHolder.Surface.isVaild = false
-
onDestroy
void onDestroy()
-
onCommand
Bundle onCommand(String pAction, int pX, int pY, int pZ, Bundle pExtras, boolean pResultRequested)
-
onTouchEvent
void onTouchEvent(MotionEvent event)
-
onOffsetsChanged
void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset)
-
onComputeColors
WallpaperColors onComputeColors()
-
-
-
-