2
votes

https://developers.google.com/glass/v1/reference/timeline#menuItems.action specifies menuItems[].values[] as being a list.

I understand that the first element of this list contains {displayName, iconUrl} for the DEFAULT state.

The description says "For CUSTOM items, a list of values controlling the appearance of the menu item in each of its states. A value for the DEFAULT state must be provided. If the PENDING or CONFIRMED states are missing, they will not be shown."

Should I assume that value[1] contains {displayName, iconUrl} for the PENDING state and value[2] contains {displayName, iconUrl} for the CONFIRMED state.

1

1 Answers

2
votes

The menuItems[].values[] resource has 3 properties:

  • displayName: text that will be displayed.
  • iconUrl: link to an icon that will be displayed along side the displayName.
  • state: the state for this value; allowed values are DEFAULT, PENDING and CONFIRMED and defaults to DEFAULT.

What happens for a user is as followed:

  1. Menu item is displayed with the displayName and iconUrl of the value that has the state DEFAULT.
  2. User taps on it: Glass displays the displayName and iconUrl of the value that has the state PENDING with a progress bar; this is the time when the user still has the ability to cancel the action.
  3. Progress bar finishes: Glass displays the displayName and iconUrl of the value that has the state CONFIRMED; the action has been processed by Glass and a notification will be sent to the Glassware on the next sync.

More information about the state property can be found in our reference guide.