Notifications

State

Text

Declaration

getText()

Discussion

Text for the notification

Example

val state:Notifications.State
assertTrue(state.text.value == "Open Garage")
// Notification text says 'Open Garage'

Action items

Declaration

getActionItems()

Example

val state:Notifications.State
assertTrue(state.actionItems[0].value?.id == 27)
assertTrue(state.actionItems[0].value?.name == "Open")
// Notification action named 'Open' with an ID 27

Activated action

Declaration

getActivatedAction()

Discussion

Identifier of the activated action

Example

val state:Notifications.State
assertTrue(state.activatedAction.value == 27)
// Activated action with ID 27

Clear

Declaration

getClear()

Example

val state:Notifications.State
assertTrue(state.clear.value == Notifications.Clear.CLEAR)
// Clear notifications

Setters

Notification

Declaration

public Notification(String text, @Nullable List<ActionItem> actionItems)

Example

val notification = Notifications.Notification("Open Garage", 
    arrayListOf(
        ActionItem(27, "Open"), 
        ActionItem(28, "Cancel"))
    )    

Action

Declaration

public Action(Integer activatedAction)

Example

val action = Notifications.Action(27)    

Clear notification

Declaration

public ClearNotification()

Example

val clearNotification = Notifications.ClearNotification()