Skip to main content

LayoutManager

The LayoutManager is responsible for sending display requests to MentraOS Cloud to show layouts in the AR view. It provides methods for displaying different types of content in the user’s field of view. You access the LayoutManager through the layouts property of a AppSession instance:

Layout Methods

showTextWall()

Displays a single, primary block of text.
Parameters:
  • text: The text content to display
  • options: Optional parameters
Example:

showDoubleTextWall()

Displays two blocks of text, one above the other.
Parameters:
  • topText: Text for the top section
  • bottomText: Text for the bottom section
  • options: Optional parameters
Example:

showReferenceCard()

Displays a card with a title and main content text.
Parameters:
  • title: The title of the card
  • text: The main content text of the card
  • options: Optional parameters
Example:

showDashboardCard()

Displays a card suitable for dashboards, typically showing a key-value pair.
Parameters:
  • leftText: Text for the left side (often a label)
  • rightText: Text for the right side (often a value)
  • options: Optional parameters
Example:

Layout Types

The LayoutManager uses several layout types internally. For reference, these are:

TextWall

See the full definition in Layout Types.

DoubleTextWall

See the full definition in Layout Types.

ReferenceCard

See the full definition in Layout Types.

DashboardCard

See the full definition in Layout Types.

View Types

The ViewType enum is used to specify where in the AR display the layout should appear:

Best Practices

  1. Choose the Right Layout: Select the layout type that best fits your content’s structure.
  2. Keep Text Concise: Screen space in AR glasses is limited. Keep your text brief and to the point.
  3. Use Duration Wisely:
    • For important information, use longer durations or no duration (persistent until replaced)
    • For notifications or transient information, use shorter durations (2-5 seconds)
  4. Dashboard vs. Main View:
    • Use the DASHBOARD view for persistent information the user may need to reference
    • Use the MAIN view for temporary information or responses to user actions