Skip to main content

Class: SoftKeyBooleanController

Defined in: src/garminsdk/softkey/SoftKeyControllers.ts:9

A controller which binds a softkey to a boolean state. Once bound, the softkey will display the bound state and each press of the softkey will toggle the value of the state.

Constructors

Constructor

new SoftKeyBooleanController(softkeyMenu, softkeyIndex, softkeyLabel, state): SoftKeyBooleanController

Defined in: src/garminsdk/softkey/SoftKeyControllers.ts:24

Constructor.

Parameters

ParameterTypeDescription
softkeyMenuSoftKeyMenuThe softkey menu to which this controller's softkey belongs.
softkeyIndexnumberThe index in the softkey menu at which this controller's softkey is located.
softkeyLabelstringThe text label of this controller's softkey.
stateMutableSubscribable<boolean>The state bound to this controller's softkey.

Returns

SoftKeyBooleanController

Methods

destroy()

destroy(): void

Defined in: src/garminsdk/softkey/SoftKeyControllers.ts:58

Destroys this controller. This will remove the softkey menu item bound to this controller's state.

Returns

void


init()

init(): SoftKeyMenuItem

Defined in: src/garminsdk/softkey/SoftKeyControllers.ts:37

Initializes this controller. This will create a softkey menu item and bind it to this controller's state.

Returns

SoftKeyMenuItem

The softkey menu item bound to this controller's state.

Throws

Error if this controller has been destroyed.