public class KanziView
extends SurfaceView
| Modifier and Type | Field and Description |
|---|---|
protected com.rightware.kanzi.KanziView.State |
mState
Current KanziView lifecycle state.
|
protected Surface |
mSurface
Valid Surface.
|
| Constructor and Description |
|---|
KanziView(Context context)
Simple constructor to use when creating a KanziView from code.
|
KanziView(Context context,
AttributeSet attrs)
Constructor that is called when inflating a KanziView from XML.
|
| Modifier and Type | Method and Description |
|---|---|
void |
createNativeApplication()
Lifecycle handler for
Lifecycle.Event.ON_CREATE events. |
void |
destroyNativeApplication()
Lifecycle handler for
Lifecycle.Event.ON_DESTROY events. |
protected void |
onFocusChanged(boolean gainFocus,
int direction,
Rect previouslyFocusedRect)
Called by the view system when the focus state of this KanziView changes.
|
boolean |
onKeyDown(int keyCode,
KeyEvent event)
A key down handler.
|
boolean |
onKeyUp(int keyCode,
KeyEvent event)
A key up handler.
|
boolean |
onTouchEvent(MotionEvent event)
Handler for touches inside KanziView.
|
void |
pauseNativeApplication()
Lifecycle handler for
Lifecycle.Event.ON_PAUSE events. |
int |
queueEvent(java.lang.Runnable runnable)
Submits a runnable task to Kanzi's task dispatcher.
|
void |
registerLifecycle(Lifecycle lifecycle)
Attaches KanziView to the given Lifecycle.
|
void |
resumeNativeApplication()
Lifecycle handler for
Lifecycle.Event.ON_RESUME events. |
void |
setOrientation(int orientation)
Handler for device/display orientation changes.
|
void |
startNativeApplication()
Lifecycle handler for
Lifecycle.Event.ON_START events. |
void |
stopNativeApplication()
Lifecycle handler for
Lifecycle.Event.ON_STOP events. |
void |
surfaceChanged(SurfaceHolder holder,
int format,
int width,
int height)
This is called immediately after any structural changes (format or
size) have been made to the surface.
|
void |
surfaceCreated(SurfaceHolder holder)
This is called immediately after the surface is first created.
|
void |
surfaceDestroyed(SurfaceHolder holder)
This is called immediately before a surface is being destroyed.
|
protected com.rightware.kanzi.KanziView.State mState
protected Surface mSurface
public KanziView(Context context)
context - The Context the KanziView is running in, through which it can
access the current theme, resources, etc.public KanziView(Context context,
AttributeSet attrs)
context - The Context the KanziView is running in, through which it can
access the current theme, resources, etc.attrs - The attributes of the XML tag that is inflating the KanziView.protected void onFocusChanged(boolean gainFocus,
int direction,
Rect previouslyFocusedRect)
gainFocus - True if the KanziView has focus; false otherwise.direction - The direction focus has moved when requestFocus()
is called to give this KanziView focus.previouslyFocusedRect - The rectangle, in this KanziView's coordinate
system, of the previously focused view. May be null.android.view.View#View(Context context, AttributeSet attrs)public boolean onKeyDown(int keyCode,
KeyEvent event)
keyCode - A key code that represents the button pressed, from
android.view.KeyEvent.event - The KeyEvent object that defines the button action.public boolean onKeyUp(int keyCode,
KeyEvent event)
keyCode - A key code that represents the button pressed, from
android.view.KeyEvent.event - The KeyEvent object that defines the button action.public boolean onTouchEvent(MotionEvent event)
event - The motion event.public void registerLifecycle(Lifecycle lifecycle)
lifecycle - The lifecycle to attach to.public void createNativeApplication()
Lifecycle.Event.ON_CREATE events.
Loads the native library providing all Kanzi functionality.
Initializes the context and assigns this KanziView for rendering.
Creates Kanzi application which loads the Kanzi project.public void destroyNativeApplication()
Lifecycle.Event.ON_DESTROY events.
Halts and destroys the Kanzi application.public void startNativeApplication()
Lifecycle.Event.ON_START events.
Runs the Kanzi application if a surface has already been received.public void stopNativeApplication()
Lifecycle.Event.ON_STOP events.
Stops the Kanzi application.public void resumeNativeApplication()
Lifecycle.Event.ON_RESUME events.
Logs the event.public void pauseNativeApplication()
Lifecycle.Event.ON_PAUSE events.
Logs the event.public void surfaceChanged(SurfaceHolder holder,
int format,
int width,
int height)
surfaceCreated(SurfaceHolder).holder - The SurfaceHolder whose surface has changed.format - The new PixelFormat of the surface.width - The new width of the surface.height - The new height of the surface.public void surfaceCreated(SurfaceHolder holder)
holder - The SurfaceHolder whose surface is being created.public void surfaceDestroyed(SurfaceHolder holder)
holder - The SurfaceHolder whose surface is being destroyed.public int queueEvent(java.lang.Runnable runnable)
runnable - The task to be run.public void setOrientation(int orientation)
orientation - The orientation qualifier from onOrientationChanged().(c) Rightware. All rights reserved.