Class: Toybox.WatchUi.ViewLoopFactory

Overview

A factory object for view/delegate instances, used by ViewLoop

Since:

API Level 3.4.0

App Types:

  • Audio Content Provider

  • Data Field

  • Glance

  • Watch App

  • Watch Face

  • Widget

Supported Devices:

Typedef Summary collapse

Instance Method Summary collapse

Typedef Details

Delegates as WatchUi.BehaviorDelegate or WatchUi.Menu2InputDelegate

Delegate types that can be provided by a ViewLoopFactory

Since:

API Level 3.4.0

Views as WatchUi.View

View types that can be provided by a ViewLoopFactory

Since:

API Level 3.4.0

Instance Method Details

getSize() as Lang.Number

Return the number of view/delegate pairs that are managed by this factory

Returns:

  • Lang.Number

    total number of views for this factory

Since:

API Level 3.4.0

getView(page as Lang.Number) as [ ViewLoopFactory.Views ] or [ ViewLoopFactory.Views, ViewLoopFactory.Delegates ]

This function will be called by the system to retrieve a view/delegate pair for the page at the given index

Note:

This method must be overridden in derived classes. If called, this function will cause the application to crash.

Note:

Menu2 and Menu2InputDelegate support added for API version 5.1.0.

Parameters:

  • page(Lang.Number)

    Index for the view/delegate pair

Returns:

Since:

API Level 3.4.0


Generated Mar 4, 2025, 4:09:53 PM