KanziSurfaceView is a specialization of SurfaceView for embedding Kanzi UI contents. More...
Public Member Functions | |
KanziSurfaceView (Context context, String name) | |
Constructor to use when creating a KanziSurfaceView from code. More... | |
KanziSurfaceView (Context context, AttributeSet attrs) | |
Constructor that is called when inflating a KanziSurfaceView from XML. More... | |
void | addListener (KanziViewListener listener) |
Adds state change listener for this view. More... | |
KanziViewAdapter | getAdapter () |
Gets the adapter of this view. More... | |
Domain | getDomain () |
Gets the Domain associated with this view. More... | |
String | getName () |
Gets the name of the view and underlying native view node. More... | |
Node2D | getRoot () |
Returns the root node of this view. More... | |
KanziRuntime | getRuntime () |
Gets the KanziRuntime associated with this view. More... | |
void | handleOrientationChange (int orientation) |
Applies device orientation changes to the contents of this view. More... | |
void | handleVisibilityChange (boolean isVisible) |
Handles visibility change events. More... | |
boolean | onKeyDown (int keyCode, KeyEvent event) |
boolean | onKeyUp (int keyCode, KeyEvent event) |
boolean | onTouchEvent (MotionEvent event) |
void | removeListener (KanziViewListener listener) |
Removes state change listener from this view. More... | |
void | setClearColor (ColorRGBA color) |
Configures the color used to clear the surface of the view before rendering its contents. More... | |
void | setName (String name) |
Sets the name for the view and underlying native view node. More... | |
void | setRoot (Node2D node) |
Sets the root node of this view, used to manually set content to the view. More... | |
void | setStartupPrefabUrl (String url) |
Configures the startup prefab that is automatically loaded during initialization. More... | |
void | setVisibility (int visibility) |
Protected Member Functions | |
void | onAttachedToWindow () |
void | onDetachedFromWindow () |
void | onFocusChanged (boolean gainFocus, int direction, @Nullable Rect previouslyFocusedRect) |
KanziSurfaceView is a specialization of SurfaceView for embedding Kanzi UI contents.
This view renders directly to a surface obtained from hardware composer, making it more performant, but with limited composability. See SurfaceView. For more flexibly composable alternative, see KanziTextureView.
KanziSurfaceView | ( | Context | context, |
String | name | ||
) |
Constructor to use when creating a KanziSurfaceView from code.
context | The Context the view is running in, through which it can access the current theme, resources, etc. |
name | A name for the underlying Kanzi view node. |
KanziSurfaceView | ( | Context | context, |
AttributeSet | attrs | ||
) |
Constructor that is called when inflating a KanziSurfaceView from XML.
context | The Context the view is running in, through which it can access the current theme, resources, etc. |
attrs | The attributes of the XML tag that is inflating the view. |
void addListener | ( | KanziViewListener | listener | ) |
Adds state change listener for this view.
listener | Listener to be called when events occur. |
Implements KanziView.
KanziViewAdapter getAdapter | ( | ) |
Domain getDomain | ( | ) |
Gets the Domain associated with this view.
Implements KanziView.
String getName | ( | ) |
Gets the name of the view and underlying native view node.
Implements KanziView.
Node2D getRoot | ( | ) |
KanziRuntime getRuntime | ( | ) |
Gets the KanziRuntime associated with this view.
Implements KanziView.
void handleOrientationChange | ( | int | orientation | ) |
Applies device orientation changes to the contents of this view.
orientation | The orientation qualifier from onOrientationChanged(). |
Implements KanziView.
void handleVisibilityChange | ( | boolean | isVisible | ) |
Handles visibility change events.
Forwards the visibility to the underlying native view node.
isVisible | When the view is visible, set to True. |
Implements KanziView.
void removeListener | ( | KanziViewListener | listener | ) |
Removes state change listener from this view.
listener | Listener to remove. |
Implements KanziView.
void setClearColor | ( | ColorRGBA | color | ) |
Configures the color used to clear the surface of the view before rendering its contents.
Default value: Opaque black i.e. (0, 0, 0, 255).
color | Color used to clear the surface of the view. Use null to skip clearing. |
Implements KanziView.
void setName | ( | String | name | ) |
Sets the name for the view and underlying native view node.
name | New name for the view. |
Implements KanziView.
void setRoot | ( | Node2D | node | ) |
Sets the root node of this view, used to manually set content to the view.
node | Node to be displayed in this view. |
Implements KanziView.
void setStartupPrefabUrl | ( | String | url | ) |
Configures the startup prefab that is automatically loaded during initialization.
url | Url of the prefab template to load. |
Implements KanziView.