public class

Gles2WatchFaceService.Engine

extends WatchFaceService.Engine

Note: The Wearable Support Library classes under the android.support.wearable package are subject to change. For the full Android API reference, see Reference.

java.lang.Object
   ↳ android.service.wallpaper.WallpaperService.Engine
     ↳ android.support.wearable.watchface.WatchFaceService.Engine
       ↳ android.support.wearable.watchface.Gles2WatchFaceService.Engine

Class Overview

The actual implementation of a watch face that draws using OpenGL ES 2.0. You must implement onCreateEngine() to return your concrete Engine implementation.

Summary

Public Constructors
Gles2WatchFaceService.Engine()
Public Methods
final void invalidate()
Schedules a call to onDraw() to draw the next frame.
void onApplyWindowInsets(WindowInsets insets)
void onCreate(SurfaceHolder surfaceHolder)
void onDestroy()
void onDraw()
Draws the watch face.
void onGlContextCreated()
Called when a new GL context is created.
void onGlSurfaceCreated(int width, int height)
Called when a new GL surface is created.
final void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height)
final void onSurfaceDestroyed(SurfaceHolder holder)
final void onSurfaceRedrawNeeded(SurfaceHolder holder)
final void postInvalidate()
Posts a message to schedule a call to onDraw() to draw the next frame.
[Expand]
Inherited Methods
From class android.support.wearable.watchface.WatchFaceService.Engine
From class android.service.wallpaper.WallpaperService.Engine
From class java.lang.Object

Public Constructors

public Gles2WatchFaceService.Engine ()

Public Methods

public final void invalidate ()

Schedules a call to onDraw() to draw the next frame. Must be called on the main thread.

public void onApplyWindowInsets (WindowInsets insets)

public void onCreate (SurfaceHolder surfaceHolder)

public void onDestroy ()

public void onDraw ()

Draws the watch face. It's safe to use GL APIs in this method.

public void onGlContextCreated ()

Called when a new GL context is created. It's safe to use GL APIs in this method.

public void onGlSurfaceCreated (int width, int height)

Called when a new GL surface is created. It's safe to use GL APIs in this method.

Parameters
width width of surface in pixels
height height of surface in pixels

public final void onSurfaceChanged (SurfaceHolder holder, int format, int width, int height)

public final void onSurfaceDestroyed (SurfaceHolder holder)

public final void onSurfaceRedrawNeeded (SurfaceHolder holder)

public final void postInvalidate ()

Posts a message to schedule a call to onDraw() to draw the next frame. Unlike invalidate(), this method is thread-safe and may be called on any thread.