diff options
| author | Evan Rosky <erosky@google.com> | 2017-04-13 16:57:18 -0700 |
|---|---|---|
| committer | Evan Rosky <erosky@google.com> | 2017-04-13 16:57:18 -0700 |
| commit | ecb63fc167a5ea474cbe97b92112b8dfff8b2217 (patch) | |
| tree | 7a71e0a94eb58b2cbd4cf4d9a69180510577dfc5 /core/java/android | |
| parent | 055b51af2860c4457041582233c9cdf9b34e1487 (diff) | |
Improve ViewDebug reporting for focus properties
Lumps them all under the focus categories so they aren't
spread out everywhere.
Added the raw focusable value.
Test: checked that focus stuff is grouped in hierarchyviewer
Change-Id: I47449cc5fe064ee88427a3adbceccfc63b88f4f9
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/View.java | 11 | ||||
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 1 |
2 files changed, 7 insertions, 5 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 9072bf93d9d8..8a0eddd5102a 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -9787,7 +9787,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.IntToString(from = NOT_FOCUSABLE, to = "NOT_FOCUSABLE"), @ViewDebug.IntToString(from = FOCUSABLE, to = "FOCUSABLE"), @ViewDebug.IntToString(from = FOCUSABLE_AUTO, to = "FOCUSABLE_AUTO") - }) + }, category = "focus") @Focusable public int getFocusable() { return (mViewFlags & FOCUSABLE_AUTO) > 0 ? FOCUSABLE_AUTO : mViewFlags & FOCUSABLE; @@ -9801,7 +9801,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return Whether the view is focusable in touch mode. * @attr ref android.R.styleable#View_focusableInTouchMode */ - @ViewDebug.ExportedProperty + @ViewDebug.ExportedProperty(category = "focus") public final boolean isFocusableInTouchMode() { return FOCUSABLE_IN_TOUCH_MODE == (mViewFlags & FOCUSABLE_IN_TOUCH_MODE); } @@ -9871,7 +9871,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return True if this view is a root of a cluster, or false otherwise. * @attr ref android.R.styleable#View_keyboardNavigationCluster */ - @ViewDebug.ExportedProperty(category = "keyboardNavigationCluster") + @ViewDebug.ExportedProperty(category = "focus") public final boolean isKeyboardNavigationCluster() { return (mPrivateFlags3 & PFLAG3_CLUSTER) != 0; } @@ -9916,7 +9916,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return {@code true} if this view is the default-focus view, {@code false} otherwise * @attr ref android.R.styleable#View_focusedByDefault */ - @ViewDebug.ExportedProperty(category = "focusedByDefault") + @ViewDebug.ExportedProperty(category = "focus") public final boolean isFocusedByDefault() { return (mPrivateFlags3 & PFLAG3_FOCUSED_BY_DEFAULT) != 0; } @@ -10029,7 +10029,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return True if this View should use a default focus highlight. * @attr ref android.R.styleable#View_defaultFocusHighlightEnabled */ - @ViewDebug.ExportedProperty(category = "defaultFocusHighlightEnabled") + @ViewDebug.ExportedProperty(category = "focus") public final boolean getDefaultFocusHighlightEnabled() { return mDefaultFocusHighlightEnabled; } @@ -25807,6 +25807,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // focus stream.addProperty("focus:hasFocus", hasFocus()); stream.addProperty("focus:isFocused", isFocused()); + stream.addProperty("focus:focusable", getFocusable()); stream.addProperty("focus:isFocusable", isFocusable()); stream.addProperty("focus:isFocusableInTouchMode", isFocusableInTouchMode()); diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 9e1ceee60cd5..27c361aa607f 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -1307,6 +1307,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager /** * Check whether this ViewGroup should ignore focus requests for itself and its children. */ + @ViewDebug.ExportedProperty(category = "focus") public boolean getTouchscreenBlocksFocus() { return (mGroupFlags & FLAG_TOUCHSCREEN_BLOCKS_FOCUS) != 0; } |
