Class: Toybox.Media.CustomButton

Overview

A CustomButton allows for a media player action other than one of the PLAYBACK_CONTROL_* actions. When a CustomButton is pressed in the media player the ContentDelegate.onCustomButton(button) function is called with the pressed button as a parameter.

Since:

API Level 3.0.3

Instance Method Summary collapse

Instance Method Details

getImage(image as Media.ButtonImage, highlighted as Lang.Boolean) as WatchUi.BitmapResource or Graphics.BitmapReference 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

  • highlighted(Lang.Boolean)

    true if the button is highlighted, otherwise false

Returns:

Since:

API Level 3.0.3

getState() as Media.ButtonState

Called by the system to determine if the current state of the button

Returns:

  • Lang.Number

    A BUTTON_STATE_* enum value representing the current state of the button

Since:

API Level 3.0.3

getText(state as Media.ButtonState) as Lang.String or Null

Called by the system to draw the name of the button

Parameters:

  • state(Lang.Number)

    A BUTTON_STATE_* value indicating the current state of the button

Returns:

Since:

API Level 3.0.3


Generated Apr 17, 2024 9:40:38 AM