Optimizing Navigation for TV optimized TV Navigation

Source: Internet
Author: User

An important aspect of the user experience when operating a TV is the direct human interface: a remote control. as you optimize your Android application for TVs, you shoshould pay special attention to how the user actually navigates around your application when using a remote control instead of a touchscreen. http://blog.csdn.net/sergeycao

This lesson shows you how to optimize navigation for TV:

Ensuring all layout controls are D-pad navigable.
Providing highly obvious feedback for UI navigation.
Placing layout controls for easy access.
Handle D-pad Navigation
On a TV, users navigate with controls on a TV remote, using either a D-pad or arrow keys. this limits movement to up, down, left, and right. to build a great TV-optimized app, you must provide a navigation scheme in which the user can quickly learn how to navigate your app using the remote.

When you design navigation for D-pad, follow these guidelines:

Ensure that the D-pad can navigate to all the visible controls on the screen.
For scrolling lists with focus, D-pad up/down keys scroll the list and Enter key selects an item in the list. ensure that users can select an element in the list and that the list still scrolls when an element is selected.
Ensure that movement between controls is straightforward and predictable.
Android usually handles navigation order between layout elements automatically, so you don't need to do anything extra. if the screen layout makes navigation difficult, or if you want users to move through the layout in a specific way, you can set up explicit navigation for your controls. for example, for an android. widget. editText, to define the next control to receive focus, use:

<EditText android: id = "@ + id/LastNameField" android: nextFocusDown = "@ + id/FirstNameField" \>
The following table lists all of the available navigation attributes:

Attribute Function
NextFocusDown Defines the next view to receive focus when the user navigates down.
NextFocusLeft Defines the next view to receive focus when the user navigates left.
NextFocusRight Defines the next view to receive focus when the user navigates right.
NextFocusUp Defines the next view to receive focus when the user navigates up.

To use one of these explicit navigation attributes, set the value to the ID (android: id value) of another widget in the layout. you shoshould set up the navigation order as a loop, so that the last control directs focus back to the first one.

Note: You should only use these attributes to modify the navigation order if the default order that the system applies does not work well.

Provide Clear Visual Indication for Focus and Selection
Use appropriate color highlights for all navigable and selectable elements in the UI. this makes it easy for users to know whether the control is currently focused or selected when they navigate with a D-pad. also, use uniform highlight scheme into SS your application.

Android provides Drawable State List Resources to implement highlights for selected and focused controls. For example:

Res/drawable/button. xml:
<? Xml version = "1.0" encoding = "UTF-8"?>
<Selector xmlns: android = "http://schemas.android.com/apk/res/android">
<Item android: state_pressed = "true"
Android: drawable = "@ drawable/button_pressed"/> <! -- Pressed -->
<Item android: state_focused = "true"
Android: drawable = "@ drawable/button_focused"/> <! -- Focused -->
<Item android: state_hovered = "true"
Android: drawable = "@ drawable/button_focused"/> <! -- Hovered -->
<Item android: drawable = "@ drawable/button_normal"/> <! -- Default -->
</Selector>
This layout XML applies the above state list drawable to a Button:

<Button
Android: layout_height = "wrap_content"
Android: layout_width = "wrap_content"
Android: background = "@ drawable/button"/>
Provide sufficient padding within the focusable and selectable controls so that the highlights around them are clearly visible.

Design for Easy Navigation
Users shoshould be able to navigate to any UI control with a couple of D-pad clicks. navigation shoshould be easy and intuitive to understand. for any non-intuitive actions, provide users with written help, using a dialog triggered by a help button or action bar icon.

Predict the next screen that the user will want to navigate to and provide one click navigation to it. if the current screen UI is very sparse, consider making it a multi pane screen. use fragments for making multi-pane screens. for example, consider the multi-pane UI below with continent names on the left and list of cool places in each continent on the right.

 
The above UI consists of three Fragments-left_side_action_controls, continents and places-as shown in its layout xml file below. such multi-pane UIs make D-pad navigation easier and make good use of the horizontal screen space for TVs.

Res/layout/cool_places.xml
<LinearLayout
Android: layout_width = "match_parent"
Android: layout_height = "match_parent"
Android: orientation = "horizontal"
>
<Fragment
Android: id = "@ + id/left_side_action_controls"
Android: layout_width = "0px"
Android: layout_height = "match_parent"
Android: layout_marginLeft = "10dip"
Android: layout_weight = "0.2"/>
<Fragment
Android: id = "@ + id/continents"
Android: layout_width = "0px"
Android: layout_height = "match_parent"
Android: layout_marginLeft = "10dip"
Android: layout_weight = "0.2"/>

<Fragment
Android: id = "@ + id/places"
Android: layout_width = "0px"
Android: layout_height = "match_parent"
Android: layout_marginLeft = "10dip"
Android: layout_weight = "0.6"/>

</LinearLayout>
Also, notice in the UI layout abve action controls are on the left hand side of a vertically scrolling list to make them easily accessible using D-pad. in general, for layouts with horizontally scrolling components, place action controls on left or right hand side and vice versa for vertically scrolling components

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.