PenProfile 2.x

com.livescribe.ext.ui
Interface Menu.MenuListener

Enclosing class:
Menu

public static interface Menu.MenuListener

This interface listens to menu changes or events.


Method Summary
 void itemChanged(Menu menu, int oldIndex, int newIndex, boolean menuActivated)
          The item in the specified menu was changed to the item having the given index.
 void itemSelected(Menu menu, int index)
          An item in the specified menu was selected (activated, executed).
 void menuShown(Menu menu)
          The specified menu was just shown on the display.
 

Method Detail

itemChanged

void itemChanged(Menu menu,
                 int oldIndex,
                 int newIndex,
                 boolean menuActivated)
The item in the specified menu was changed to the item having the given index. This is called when a list scrolls up or down or when a new menu was made active. The menuActivated parameter discerns whether the menu was freshly activated or simply changing items.

The new index can be -1 if the title is showing.

Note: It is possible for the new index to equal the old index, for example when the menu has been activated or when a focus change has been requested and the item is not changed.

Note 2: This can also be called when the index has changed without the menu showing on the display.

Parameters:
menu - the menu
oldIndex - the index of the previously shown item
newIndex - the index of the newly shown item
menuActivated - indicates whether this menu was newly activated

itemSelected

void itemSelected(Menu menu,
                  int index)
An item in the specified menu was selected (activated, executed). This is called when the user selects forward on a specific menu item. This is called regardless of whether the item is selectable.

This method provides a way for menu selection to trigger an action. This will be called whether there is a submenu or not, and before any new menu is shown.

This provides an alternative to Menu.MenuAction which can be tied to specific menu items rather than the whole menu.

Parameters:
menu - the menu
index - the selected item index
See Also:
Menu.MenuAction

menuShown

void menuShown(Menu menu)
The specified menu was just shown on the display.

Parameters:
menu - the menu
See Also:
Menu.show(Display, Transition)

PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.