Screen

The Screen class represents a screen to be displayed on the glasses.

This is the main entry point within the SDK to create and send visual data to the glasses display.

You should inherit from this class in order to create application screens to be displayed on the glasses (similar to iOS viewController or Android Activity)

The Screen lifecycle is as follows:

Inheritors

Constructors

Link copied to clipboard
constructor()
constructor(screenWidth: Float, screenHeight: Float)
constructor(name: String)
constructor(name: String, screenWidth: Float, screenHeight: Float)

Types

Link copied to clipboard

Screen render rate enumerator. Used to define the screen required render rate

Functions

Link copied to clipboard
fun add(uiElement: UIElement)

Add a ui element to the screen

Link copied to clipboard
fun addAll(uiElements: List<UIElement>)

Add a list of UIElements to the screen

Link copied to clipboard
fun clip(shouldClip: Boolean)

Clip the Screen rendering to its boundaries

Link copied to clipboard

Close the current popup message if shown

Link copied to clipboard

returns a ui element that was added to the screen

Link copied to clipboard

Receive the ui elements that were added to the screen

Link copied to clipboard

Indicates if the screen has ui elements

Link copied to clipboard

Receive the screen rendering area height. The height is depends on the glasses hardware and is available ONLY after the connection was established.

Link copied to clipboard
fun getId(): Int

Get the screen id (auto generated)

Link copied to clipboard

Get the name

Link copied to clipboard

Return the current displayed popup message or null if not exist

Link copied to clipboard

Receive the screen rendering area width. The width is depends on the glasses hardware and is available ONLY after the connection was established.

Link copied to clipboard
Link copied to clipboard

Indicates if the screen is paused

Link copied to clipboard

Indicates if the screen is resumed

Link copied to clipboard
protected open fun onCreate()

Override this function to be notified when the screen is created

Link copied to clipboard
protected open fun onDestroy()

Override this function to be notified when the screen is destroyed

Link copied to clipboard
protected open fun onPause()

Override this function to be notified when the screen is paused

Link copied to clipboard
protected open fun onPopupClosed(message: PopupMessage)

Override this function to be notified when the message that was requested to be shown via showPopup was removed

Link copied to clipboard
protected open fun onResourcesUploadEnd()

Override this function to be notified when the resources upload batch process was ended

Link copied to clipboard
protected open fun onResourceUploadResult(resource: UIResource)

Override this function to be notified about a single resource upload result The function is called when the resource was uploaded successfully or the upload was failed

Link copied to clipboard
protected open fun onResume()

Override this function to be notified when the screen is resumed

Link copied to clipboard
protected open fun onTouch(touch: TouchDirection)

Override this function to be notified about the glasses touch gestures

Link copied to clipboard
protected open fun onUpdateUI(timestampMs: Long)

Override this function to be notified when the screen is about to be drawn

Link copied to clipboard
fun remove(uiElement: UIElement)

Remove a ui element from the screen

Link copied to clipboard
fun removeAll()

Remove all ui elements from the screen

Link copied to clipboard

This function starts uploading the resources to the glasses. Usually this function should be called within the onCreate or the onResume functions, as part of the screen UI preparations

Link copied to clipboard
fun sendToBack(uiElement: UIElement)

Set the UIElement to be the last element

Link copied to clipboard

set the screen render rate

Link copied to clipboard
fun setTopmost(uiElement: UIElement)

Set the UIElement to be the topmost element in the screen

Link copied to clipboard

Shows the given ui Element on the screen for a predefined time timeoutMs

Link copied to clipboard
open override fun toString(): String

returns a string with the screen name & id

Link copied to clipboard

Indicates if the screen was created