java.lang.Object | |
↳ | android.service.wallpaper.WallpaperService.Engine |
The actual implementation of a wallpaper. A wallpaper service may
have multiple instances running (for example as a real wallpaper
and as a preview), each of which is represented by its own Engine
instance. You must implement onCreateEngine()
to return your concrete Engine implementation.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convenience for
WallpaperManager.getDesiredMinimumHeight() , returning the height
that the system would like this wallpaper to run in.
| |||||||||||
Convenience for
WallpaperManager.getDesiredMinimumWidth() , returning the width
that the system would like this wallpaper to run in.
| |||||||||||
Provides access to the surface in which this wallpaper is drawn.
| |||||||||||
Returns true if this engine is running in preview mode -- that is,
it is being shown to the user before they select it as the actual
wallpaper.
| |||||||||||
Return whether the wallpaper is currently visible to the user,
this is the last value supplied to
onVisibilityChanged(boolean) .
| |||||||||||
Called with the current insets that are in effect for the wallpaper.
| |||||||||||
Process a command that was sent to the wallpaper with
sendWallpaperCommand(IBinder, String, int, int, int, Bundle) .
| |||||||||||
Called once to initialize the engine.
| |||||||||||
Called when an application has changed the desired virtual size of
the wallpaper.
| |||||||||||
Called right before the engine is going away.
| |||||||||||
Called to inform you of the wallpaper's offsets changing
within its contain, corresponding to the container's
call to
WallpaperManager.setWallpaperOffsets() .
| |||||||||||
Convenience for
SurfaceHolder.Callback.surfaceChanged() .
| |||||||||||
Convenience for
SurfaceHolder.Callback.surfaceCreated() .
| |||||||||||
Convenience for
SurfaceHolder.Callback.surfaceDestroyed() .
| |||||||||||
Convenience for
SurfaceHolder.Callback.surfaceRedrawNeeded() .
| |||||||||||
Called as the user performs touch-screen interaction with the
window that is currently showing this wallpaper.
| |||||||||||
Called to inform you of the wallpaper becoming visible or
hidden.
| |||||||||||
Control whether this wallpaper will receive notifications when the wallpaper
has been scrolled.
| |||||||||||
Control whether this wallpaper will receive raw touch events
from the window manager as the user interacts with the window
that is currently displaying the wallpaper.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Convenience for WallpaperManager.getDesiredMinimumHeight()
, returning the height
that the system would like this wallpaper to run in.
Convenience for WallpaperManager.getDesiredMinimumWidth()
, returning the width
that the system would like this wallpaper to run in.
Provides access to the surface in which this wallpaper is drawn.
Returns true if this engine is running in preview mode -- that is, it is being shown to the user before they select it as the actual wallpaper.
Return whether the wallpaper is currently visible to the user,
this is the last value supplied to
onVisibilityChanged(boolean)
.
Called with the current insets that are in effect for the wallpaper. This gives you the part of the overall wallpaper surface that will generally be visible to the user (ignoring position offsets applied to it).
insets | Insets to apply. |
---|
Process a command that was sent to the wallpaper with
sendWallpaperCommand(IBinder, String, int, int, int, Bundle)
.
The default implementation does nothing, and always returns null
as the result.
action | The name of the command to perform. This tells you what to do and how to interpret the rest of the arguments. |
---|---|
x | Generic integer parameter. |
y | Generic integer parameter. |
z | Generic integer parameter. |
extras | Any additional parameters. |
resultRequested | If true, the caller is requesting that a result, appropriate for the command, be returned back. |
Called once to initialize the engine. After returning, the engine's surface will be created by the framework.
Called when an application has changed the desired virtual size of the wallpaper.
Called right before the engine is going away. After this the surface will be destroyed and this Engine object is no longer valid.
Called to inform you of the wallpaper's offsets changing
within its contain, corresponding to the container's
call to WallpaperManager.setWallpaperOffsets()
.
Convenience for SurfaceHolder.Callback.surfaceChanged()
.
Convenience for SurfaceHolder.Callback.surfaceCreated()
.
Convenience for SurfaceHolder.Callback.surfaceDestroyed()
.
Convenience for SurfaceHolder.Callback.surfaceRedrawNeeded()
.
Called as the user performs touch-screen interaction with the window that is currently showing this wallpaper. Note that the events you receive here are driven by the actual application the user is interacting with, so if it is slow you will get fewer move events.
Called to inform you of the wallpaper becoming visible or hidden. It is very important that a wallpaper only use CPU while it is visible..
Control whether this wallpaper will receive notifications when the wallpaper has been scrolled. By default, wallpapers will receive notifications, although the default static image wallpapers do not. It is a performance optimization to set this to false.
enabled | whether the wallpaper wants to receive offset notifications |
---|
Control whether this wallpaper will receive raw touch events
from the window manager as the user interacts with the window
that is currently displaying the wallpaper. By default they
are turned off. If enabled, the events will be received in
onTouchEvent(MotionEvent)
.