SurfaceControlCallback


public interface SurfaceControlCallback


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

Summary

Public methods

default void

Notifies when there is an error.

abstract void

Notifies when android.view.SurfaceView receives a new key event.

abstract void

Notifies when android.view.SurfaceView receives a new touch event.

abstract void
onWindowFocusChanged(boolean hasFocus, boolean isInTouchMode)

Notifies when the window focus changes.

abstract void

Notifies when the underlying surface changes.

Public methods

onError

Added in 1.1.0
default void onError(@NonNull String msg, @NonNull Throwable e)

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

onKeyEvent

Added in 1.1.0
abstract void onKeyEvent(@NonNull KeyEvent event)

Notifies when android.view.SurfaceView receives a new key event.

onTouchEvent

Added in 1.1.0
abstract void onTouchEvent(@NonNull MotionEvent event)

Notifies when android.view.SurfaceView receives a new touch event.

onWindowFocusChanged

Added in 1.1.0
abstract void onWindowFocusChanged(boolean hasFocus, boolean isInTouchMode)

Notifies when the window focus changes.

setSurfaceWrapper

Added in 1.1.0
abstract void setSurfaceWrapper(@NonNull SurfaceWrapper surfaceWrapper)

Notifies when the underlying surface changes.