Introducing the Android Menu System

If you've ever tried to navigate a mobile phone menu system using a stylus or trackball, you know that traditional menu systems are awkward to use on mobile devices.

To improve the usability of application menus, Android features a three-stage menu system optimized for small screens:

> The icon menu This compact menu (shown in Figure 4-7) appears along the bottom of the screen when the menu button is pressed. It displays the icons and text for a limited number of Menu Items (typically six). By convention, menu icons are grayscale images in an embossed style, though this may vary on different devices.

This icon menu does not display checkboxes, radio buttons, or the shortcut keys for Menu Items, so it's generally good practice not to depend on checkboxes or radio buttons in icon Menu Items, as they will not be visible.

If the Activity menu contains more than the maximum number of visible Menu Items, a More Menu Item is displayed. When selected, it displays the expanded menu. Pressing the back button closes the icon menu.

FIGURE 4-7

> The expanded menu The expanded menu is triggered when a user selects the More Menu Item from the icon menu. The expanded menu (shown in Figure 4-8) displays a scrollable list of only the Menu Items that weren't visible in the icon menu. This menu displays full text, shortcut keys, and checkboxes/radio buttons.

It does not, however, display icons. Pressing back from the expanded menu returns you to the icon menu.

Mmu tem 6 ChKkftM ffsdlobutu*» t Ridlebunon I n NIII-Inimhhi Î iubmfnu

FIGURE 4-8

You cannot force Android to display the expanded menu instead of the icon menu. As a result, special care must be taken ivith Menu Items that feature checkboxes or radio buttons. The maximum number of icon Menu Items can vary by device, so it's good practice to ensure that their state information is also indicated by an icon or a change in text.

> Submenus The traditional expanding hierarchical tree can be awkward to navigate using a mouse, so it's no surprise that this metaphor is particularly ill-suited for use on mobile devices. The Android alternative is to display each submenu in a floating window.

For example, when a user selects a submenu such as the creatively labeled Submenu shown in Figure 4-8, its items are displayed in a floating menu dialog box, as shown in Figure 4-9.

Note that the name of the submenu is shown in the header bar and that each Menu Item is displayed with its full text, checkbox (if any), and shortcut key. Since Android does not support nested submenus, you can't add a submenu to a submenu (trying will result in an exception).

As with the extended menu, icons are not displayed in the submenu, so it's good practice to avoid assigning icons to submenu items.

Pressing the back button closes the floating window without your having to navigate back to the extended or icon menus.

Android Menu Icons
FIGURE 4-9
Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide


Post a comment