From 55b9ed42d3e1f61794d23cd0f4a04d01c51eab14 Mon Sep 17 00:00:00 2001 From: Joseph Cooper Date: Wed, 15 Apr 2015 16:21:58 -0700 Subject: [PATCH] Introduces navigation keycodes. These four new navigation keycodes are intended to be used to navigate a tree hierarchy or list of items. They should be used to allow the user to advance forward or backward within a list of sibling items, expand the currently selected item to navigate the item's children, or back out from the current item to its parent item or state. Change-Id: Ie2b85b3e4c682b0698599d7bcf64a53f6a52d776 --- api/current.txt | 4 ++++ api/system-current.txt | 4 ++++ core/java/android/view/KeyEvent.java | 16 +++++++++++++++- core/res/res/values/attrs.xml | 4 ++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index d73b9f95f287e..d8780bc2dc280 100644 --- a/api/current.txt +++ b/api/current.txt @@ -34917,6 +34917,10 @@ package android.view { field public static final int KEYCODE_MUSIC = 209; // 0xd1 field public static final int KEYCODE_MUTE = 91; // 0x5b field public static final int KEYCODE_N = 42; // 0x2a + field public static final int KEYCODE_NAVIGATE_IN = 262; // 0x106 + field public static final int KEYCODE_NAVIGATE_NEXT = 261; // 0x105 + field public static final int KEYCODE_NAVIGATE_OUT = 263; // 0x107 + field public static final int KEYCODE_NAVIGATE_PREVIOUS = 260; // 0x104 field public static final int KEYCODE_NOTIFICATION = 83; // 0x53 field public static final int KEYCODE_NUM = 78; // 0x4e field public static final int KEYCODE_NUMPAD_0 = 144; // 0x90 diff --git a/api/system-current.txt b/api/system-current.txt index f98e15f2996c9..40f62e168f6f0 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -37082,6 +37082,10 @@ package android.view { field public static final int KEYCODE_MUSIC = 209; // 0xd1 field public static final int KEYCODE_MUTE = 91; // 0x5b field public static final int KEYCODE_N = 42; // 0x2a + field public static final int KEYCODE_NAVIGATE_IN = 262; // 0x106 + field public static final int KEYCODE_NAVIGATE_NEXT = 261; // 0x105 + field public static final int KEYCODE_NAVIGATE_OUT = 263; // 0x107 + field public static final int KEYCODE_NAVIGATE_PREVIOUS = 260; // 0x104 field public static final int KEYCODE_NOTIFICATION = 83; // 0x53 field public static final int KEYCODE_NUM = 78; // 0x4e field public static final int KEYCODE_NUMPAD_0 = 144; // 0x90 diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index 779560cb15f0b..1ac3f4598d949 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -747,8 +747,22 @@ public class KeyEvent extends InputEvent implements Parcelable { public static final int KEYCODE_TV_TIMER_PROGRAMMING = 258; /** Key code constant: Help key. */ public static final int KEYCODE_HELP = 259; + /** Key code constant: Navigate to previous key. + * Goes backward by one item in an ordered collection of items. */ + public static final int KEYCODE_NAVIGATE_PREVIOUS = 260; + /** Key code constant: Navigate to next key. + * Advances to the next item in an ordered collection of items. */ + public static final int KEYCODE_NAVIGATE_NEXT = 261; + /** Key code constant: Navigate in key. + * Activates the item that currently has focus or expands to the next level of a navigation + * hierarchy. */ + public static final int KEYCODE_NAVIGATE_IN = 262; + /** Key code constant: Navigate out key. + * Backs out one level of a navigation hierarchy or collapses the item that currently has + * focus. */ + public static final int KEYCODE_NAVIGATE_OUT = 263; - private static final int LAST_KEYCODE = KEYCODE_HELP; + private static final int LAST_KEYCODE = KEYCODE_NAVIGATE_OUT; // NOTE: If you add a new keycode here you must also add it to: // isSystem() diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 674c695a6776f..0b6c9f5ea5932 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1783,6 +1783,10 @@ + + + +