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:

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:

  • Media.ButtonState

    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(Media.ButtonState)

    A BUTTON_STATE_* value indicating the current state of the button

Returns:

Since:

API Level 3.0.3


Generated Sep 23, 2024, 3:32:49 PM