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

Note:

The default value for :page is 0

Note:

The default value for the :wrap option is true

Note:

:color options may be ignored if the device do not support accent colors

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.

    • :wrap(Lang.Boolean)

      if wrapping through the pages is allowed

    • :color(Graphics.ColorType)

      accent color for the page indicator.

Since:

API Level 3.4.0

Throws:


Generated Apr 17, 2024 9:40:39 AM