SurfaceControlCallback

public interface SurfaceControlCallback

androidx.car.app.activity.renderer.surface.SurfaceControlCallback


A host-side interface for reporting to an off-process renderer events affecting the SurfaceView it renders content on.

Summary

Public methods

default void onError(String msg, Throwable e)

Notifies when there is an error.

abstract void onKeyEvent(KeyEvent event)

Notifies when SurfaceView receives a new key event.

abstract void onTouchEvent(MotionEvent event)

Notifies when SurfaceView receives a new touch event.

abstract void onWindowFocusChanged(boolean hasFocus, boolean isInTouchMode)

Notifies when the window focus changes.

abstract void setSurfaceWrapper(SurfaceWrapper surfaceWrapper)

Notifies when the underlying surface changes.

Public methods

onError

public void onError (String msg, 
                Throwable e)

Notifies when there is an error. Provide default implementation for easier transition.

Parameters
msg String

e Throwable

onKeyEvent

public abstract void onKeyEvent (KeyEvent event)

Notifies when SurfaceView receives a new key event.

Parameters
event KeyEvent

onTouchEvent

public abstract void onTouchEvent (MotionEvent event)

Notifies when SurfaceView receives a new touch event.

Parameters
event MotionEvent

onWindowFocusChanged

public abstract void onWindowFocusChanged (boolean hasFocus, 
                boolean isInTouchMode)

Notifies when the window focus changes.

Parameters
hasFocus boolean

isInTouchMode boolean

setSurfaceWrapper

public abstract void setSurfaceWrapper (SurfaceWrapper surfaceWrapper)

Notifies when the underlying surface changes.

Parameters
surfaceWrapper SurfaceWrapper