AppView 0.8.2
AppViewController Class Reference

Represents the AppView2D or AppView3D Kanzi node. More...

Inherits AppViewControllerDirectorBase.

Public Member Functions

void onEmbeddedApplicationStarted ()
 Notifies a corresponding AppView node that the application started.
 
void onEmbeddedApplicationStopped ()
 Notifies a corresponding AppView node that the running application stopped.
 
void onFrameAvailable ()
 Notifies a corresponding AppView node that a new frame is available.
 

Protected Member Functions

boolean acquireDisplay (String virtualDisplayName)
 
String getAppName ()
 Returns the embedded activity component name.
 
int getTextureId ()
 
long getVirtualDisplayDensity ()
 
long getVirtualDisplayHeight ()
 
String getVirtualDisplayName ()
 
long getVirtualDisplayWidth ()
 
boolean initializeDisplay (int virtualDisplayWidth, int virtualDisplayHeight, int virtualDisplayDensity)
 Initializes a virtual display backed by the given texture.
 
boolean injectPointerEvents (int event, int pointerIndex, TouchPointInfoVector pointers)
 
boolean navigateBack ()
 Performs back navigation inside the virtual display.
 
void pauseApp ()
 Pauses the embedded app.
 
void releaseDisplay ()
 Releases resources.
 
void resumeApp ()
 Resumes the embedded app.
 
boolean startApp (String appName, boolean canExitApp)
 Starts the given app inside the virtual display.
 
boolean updateDisplay (int newDisplayWidth, int newDisplayHeight, int newDisplayDensity)
 Updates the virtual display paramaters.
 
float[] updateTextureContent ()
 Updates pixels on an output texture.
 

Detailed Description

Represents the AppView2D or AppView3D Kanzi node.

Member Function Documentation

◆ getAppName()

String getAppName ( )
protected

Returns the embedded activity component name.

AppViewController is in charge of running that component. Used in the native layer to make sure that the Kanzi.AppViewConcept.EmbeddedActivityComponentName property has a matching value.

Returns
The embedded activity component name or empty string. Returns an empty string when the embedded activity is not running or has stopped.

◆ initializeDisplay()

boolean initializeDisplay ( int virtualDisplayWidth,
int virtualDisplayHeight,
int virtualDisplayDensity )
protected

Initializes a virtual display backed by the given texture.

Parameters
virtualDisplayWidthVirtual display width
virtualDisplayHeightVirtual display height
virtualDisplayDensityVirtual display density (dpi)
Returns
True on success, false on error.

◆ navigateBack()

boolean navigateBack ( )
protected

Performs back navigation inside the virtual display.

It has the same effect as pressing the back button on an Android device.

Returns
True on success, false on error.

◆ onEmbeddedApplicationStarted()

void onEmbeddedApplicationStarted ( )

Notifies a corresponding AppView node that the application started.

When called, the AppView node starts displaying the associated external texture in the Kanzi UI scene.

◆ onEmbeddedApplicationStopped()

void onEmbeddedApplicationStopped ( )

Notifies a corresponding AppView node that the running application stopped.

When called, the AppView node restores its original state. In this state, it renders nothing.

◆ releaseDisplay()

void releaseDisplay ( )
protected

Releases resources.

Destroys the virtual display and stops the app running inside the AppView.

◆ startApp()

boolean startApp ( String appName,
boolean canExitApp )
protected

Starts the given app inside the virtual display.

Parameters
appNameThe app name. Formatted as "package.name/activity.name". See ComponentName.unflattenFromString() for details.
canExitAppTrue if it's allowed to exit the app via navigateBack()
Returns
True on success, false on error.

◆ updateDisplay()

boolean updateDisplay ( int newDisplayWidth,
int newDisplayHeight,
int newDisplayDensity )
protected

Updates the virtual display paramaters.

Parameters
newDisplayWidthThe new virtual display width
newDisplayHeightThe new virtual display height
newDisplayDensityThe new virtual display density (dpi)
Returns
True on success, false on error.

◆ updateTextureContent()

float[] updateTextureContent ( )
protected

Updates pixels on an output texture.

Returns
An array that contains the texture transformation matrix. If there is no new texture content, returns null. Returns the same array every time. Therefore the caller does not have to keep or modify the previous values.