Class: Toybox.WatchUi.ViewLoop

Inherits:
Toybox.Lang.Object show all

Overview

An object representing the view loop with a collection of scrollable views.

Since:

API Level 3.4.0

Supported Devices:

Constant Summary

Direction

Specifies the direction to transition views

Since:

API Level 3.4.0

Name Value Since Description See Also
DIRECTION_NEXT 0

API Level 3.4.0

Loop in the forward direction

DIRECTION_PREVIOUS 1

API Level 3.4.0

Loop in the backward direction

Instance Method Summary collapse

Instance Method Details

changeView(direction as ViewLoop.Direction) as Lang.Boolean

Change the view to the next/previous one in the view loop based on the direction and display the page indicator after transitioning.

Parameters:

Returns:

  • Lang.Boolean

    true if view is changed, otherwise false, e.g. reached the start/end of of non-wrapping loop.

Since:

API Level 3.4.0

Throws:

initialize(factory as WatchUi.ViewLoopFactory, options as { :page as Lang.Number, :wrap as Lang.Boolean, :color as Graphics.ColorType } or Null)

Constructor for the ViewLoop

Parameters:

  • factory(WatchUi.ViewLoopFactory)

    A factory object for the view loop to retrieve view and delegates managed with in this view loop

  • options(Lang.Dictionary)

    Options for this view loop object

    • :page(Lang.Number)

      initial page index for the view loop. The default value is 0.

    • :wrap(Lang.Boolean)

      if wrapping through the pages is allowed The default value is true.

    • :color(Graphics.ColorType)

      accent color for the page indicator. The :color option may be ignored if the device does not support accent colors.

Since:

API Level 3.4.0

Throws:


Generated Dec 11, 2024, 8:58:44 AM