Module: Toybox.ActivityPrompts
Overview
The ActivityPrompts module allows a data field to handle audio output during an activity.
Using this module will cause to all activity prompts during an activity to no longer play through the device or any connected devices such as headphones. The user must select the data field as the activity prompt handler in the device menus.
Prompts will be passed to ActivityPromptDelegate.onPrompt() when they are to be played. If more than
one prompt is passed to ActivityPromptDelegate::onPrompt(), they are meant to be played together uninterrupted.
Classes Under Namespace
Classes: ActivityPrompt, ActivityPromptDelegate
Typedef Summary collapse
- ActivityPromptContextValue as Lang.Boolean or Lang.Number or Lang.Double or Lang.String or Lang.Dictionary<Lang.String, ActivityPrompts.ActivityPromptContextValue> or Lang.Array<ActivityPrompts.ActivityPromptContextValue> or Null
Instance Method Summary collapse
-
registerActivityPromptsListener(delegate as ActivityPrompts.ActivityPromptDelegate, options as Lang.Dictionary or Null) as Lang.Boolean
Register as the activity prompt output provider.
-
setActivityPromptTextLanguage(languages as System.Language) as Lang.Boolean
Set the language for ActivityPrompt.text.
-
unregisterActivityPromptsListener() as Void
Unregister as the activity prompt output handler.
Typedef Details
ActivityPromptContextValue as Lang.Boolean or Lang.Number or Lang.Double or Lang.String or Lang.Dictionary<Lang.String, ActivityPrompts.ActivityPromptContextValue> or Lang.Array<ActivityPrompts.ActivityPromptContextValue> or Null
Instance Method Details
registerActivityPromptsListener(delegate as ActivityPrompts.ActivityPromptDelegate, options as Lang.Dictionary or Null) as Lang.Boolean
Register as the activity prompt output provider. true will only be returned only if the data field is the selected activity prompt output provider. If false
is returned, ActivityPromptDelegate.onAudioOutputChange() will be called with true if the data field becomes the selected activity prompt output provider.
setActivityPromptTextLanguage(languages as System.Language) as Lang.Boolean
Set the language for ActivityPrompt.text.
unregisterActivityPromptsListener() as Void
Unregister as the activity prompt output handler. Activity prompt output will return to the default provider if the data field is the current provider.