Android TV-Creating TV Navigation
来源:互联网 发布:c语言100道经典案例 编辑:程序博客网 时间:2024/06/09 23:14
TV devices provide a limited set of navigation controls for apps. Creating an effective navigation scheme for your TV app depends on understanding these limited controls and the limits of users' perception while operating your app. As you build your Android app for TVs, pay special attention to how the user actually navigates around your app when using remote control buttons instead of a touch screen.
This type of control limits movement to up, down, left, and right. To build a great TV-optimized app, you must provide a navigation scheme where the user can quickly learn how to navigate your app using these limited controls.
The Android framework handles directional navigation between layout elements automatically, so you typically do not need to do anything extra for your app. However, you should thoroughly test navigation with a D-pad controller to discover any navigation problems. Follow these guidelines to test that your app's navigation system works well with a D-pad on a TV device:
- Ensure that a user with a D-pad controller can navigate to all visible controls on the screen.
- For scrolling lists with focus, make sure that the D-pad up and down keys scroll the list, and the Enter key selects an item in the list. Verify that users can select an element in the list and that the list still scrolls when an element is selected.
- Ensure that switching between controls between controls is straightforward and predictable.
<TextView android:id="@+id/Category1" android:nextFocusDown="@+id/Category2"\>
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. Your app layout and implementation should use color, size, animation, or a combination of these attributes to help users easily determine what actions they can take next. Use a uniform scheme for indicating focus across your application.Android provides Drawable State List Resources to implement highlights for focused and selected controls. The following code example demonstrates how to enable visual behavior for a button to indicate that a user has navigated to the control and then selected it:
<!-- 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>
- Android TV-Creating TV Navigation
- Android TV -1.4 Creating TV Navigation
- Android TV 官方教程简读4-Creating TV Navigation
- Android TV -2.1- Creating a Catalog Browser
- Android TV
- Android TV
- TV
- TV
- [中英文对照]android Designing for TV(二) ------ Optimizing Navigation for TV 优化电视导航
- Android TV-Handling TV Hardware
- android TV-Recommending TV Content,
- android tv-Building TV Games
- android tv-TV Apps Checklist
- android TV - Creating a Catalog Browser,Providing a Card View
- Android TV-Building TV Apps,Get Started with TV Apps
- android TV-Making TV Apps Searchable,Searching within TV Apps
- android TV-Building TV Channels,Developing a TV Input Service
- Google-TV或更名为“Android-TV”
- android 自定义View于软键盘之上
- Android View绘制之旅
- Odd Even Linked List leetcode 328
- java.io.CharConversionException isHexDigit JS转码问题
- json基本操作
- Android TV-Creating TV Navigation
- 大学毕业的忧伤
- POJ 2240 Arbitrage
- 修改rhel yum
- 笔记本使用时间长后关不了机,假死
- ThreadLocal详解
- 高并发服务端分布式系统设计概要
- 去除一个字符串中数字的三种方法
- 循环队列的基本操作