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:

  • onCreate

  • -- onResume

  • ----- onUpdateUI

  • ----- (here the screen is actually drawn and sent to the glasses)

  • -- onPause

  • onDestroy

Inheritors

Constructors

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

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

Return the current displayed popup message or null if not exist

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
fun remove(uiElement: UIElement)

Remove a ui element from the screen

Link copied to clipboard

Removes the Screen from the screens stack.

Link copied to clipboard
fun sendToBack(uiElement: UIElement)

Set the UIElement to be the last element

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