0

Is there any way to set the display name and default value of a default menu action?

Something like this:

$menu_item = new Google_MenuItem();
$menu_item->setDisplayName("Shipped");
$menu_item->setAction("REPLY");
array_push($menu_items, $menu_item);

$new_timeline_item->setMenuItems($menu_items);

insert_timeline_item($mirror_service, $new_timeline_item, null, null);

BTW, I know that I would have to add the variable "displayname" to the class called "Google_MenuItem()" but I have not yet gotten it to work. Has anyone found a workaround?

Im using the PHP API.

I know that this is a re-post but the question was asked a while back.

AJ Birone
  • 151
  • 2
  • 9

1 Answers1

0

It sounds like you want the "Reply" menu item to have a different title show up for it, is that correct? If so, what you want to set are the MenuValues for this menu item through $menu_item->setValues() which takes an array. The array consists of MenuValues for the menu item before it is selected, when it is selected, and after it is selected (the three states). See https://developers.google.com/glass/v1/reference/timeline and scroll down to the part about menuItems for details.

Code for what you want might look something like this (untested):

$menu_value_default = new Google_MenuItem();
$menu_value_default->setState('DEFAULT');
$menu_value_default->setDisplayName('Ship');

$menu_item = new Google_MenuItem();
$menu_item->setAction("REPLY");
$menu_item->setValues(array($menu_value_default));
Prisoner
  • 49,922
  • 7
  • 53
  • 105