Class: Toybox.Media.SystemButton

Overview

A SystemButton allows an app to override a default media player button. The button can be overridden by providing a new Toybox::WatchUi::BitmapResource, Toybox:Graphics::BitmapReference or a Toybox::Lang::Number representing a 24-bit RRGGBB color value. If a color value is provided then the system default button will be used but will drawn using the given color.

Note:

BitmapReference is only supported in CIQ 4.0.0 and later

Since:

API Level 3.0.3

Instance Method Summary collapse

Instance Method Details

getImage(image as Media.ButtonImage, state as Media.ButtonState, highlighted as Lang.Boolean) as Graphics.BitmapType or Graphics.ColorType or Null

Called by the system to draw the button in the Media Player

Note:

BitmapReference is only supported in CIQ 4.0.0 and later

Parameters:

  • image(Lang.Number)

    A BUTTON_IMAGE_* value

  • state(Lang.Number)

    A BUTTON_STATE_* value indicating the current state of the button

  • highlighted(Lang.Boolean)

    Set to true if the button is highlighted, otherwise false

Returns:

Since:

API Level 3.0.3

initialize(type as Media.PlaybackControl, options as { :disabled as Lang.Boolean } or Null)

Constructor

Parameters:

  • type(Lang.Number)

    A PLAYBACK_CONTROL_* value for the button.

  • options(Lang.Dictionary)

    A Dictionary of options

    • :disabled(Lang.Boolean)

      Set to true if the button is disabled, otherwise false

Since:

API Level 3.0.3


Generated Apr 17, 2024 9:40:38 AM