Loading core/java/android/view/View.java +15 −2 Original line number Diff line number Diff line Loading @@ -13249,6 +13249,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, && ((privateFlags & PFLAG_FOCUSED) != 0)) { /* Give up focus if we are no longer focusable */ clearFocus(); if (mParent instanceof ViewGroup) { ((ViewGroup) mParent).clearFocusedInCluster(); } } else if (((old & FOCUSABLE) == NOT_FOCUSABLE) && ((privateFlags & PFLAG_FOCUSED) == 0)) { /* Loading Loading @@ -13296,7 +13299,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, requestLayout(); if (((mViewFlags & VISIBILITY_MASK) == GONE)) { if (hasFocus()) clearFocus(); if (hasFocus()) { clearFocus(); if (mParent instanceof ViewGroup) { ((ViewGroup) mParent).clearFocusedInCluster(); } } clearAccessibilityFocus(); destroyDrawingCache(); if (mParent instanceof View) { Loading Loading @@ -13324,7 +13332,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (((mViewFlags & VISIBILITY_MASK) == INVISIBLE)) { // root view becoming invisible shouldn't clear focus and accessibility focus if (getRootView() != this) { if (hasFocus()) clearFocus(); if (hasFocus()) { clearFocus(); if (mParent instanceof ViewGroup) { ((ViewGroup) mParent).clearFocusedInCluster(); } } clearAccessibilityFocus(); } } core/java/android/view/ViewGroup.java +7 −0 Original line number Diff line number Diff line Loading @@ -818,6 +818,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (mFocusedInCluster != child) { return; } clearFocusedInCluster(); } /** * Removes the focusedInCluster chain from this up to the cluster containing it. */ void clearFocusedInCluster() { View top = findKeyboardNavigationCluster(); ViewParent parent = this; do { Loading Loading
core/java/android/view/View.java +15 −2 Original line number Diff line number Diff line Loading @@ -13249,6 +13249,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, && ((privateFlags & PFLAG_FOCUSED) != 0)) { /* Give up focus if we are no longer focusable */ clearFocus(); if (mParent instanceof ViewGroup) { ((ViewGroup) mParent).clearFocusedInCluster(); } } else if (((old & FOCUSABLE) == NOT_FOCUSABLE) && ((privateFlags & PFLAG_FOCUSED) == 0)) { /* Loading Loading @@ -13296,7 +13299,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, requestLayout(); if (((mViewFlags & VISIBILITY_MASK) == GONE)) { if (hasFocus()) clearFocus(); if (hasFocus()) { clearFocus(); if (mParent instanceof ViewGroup) { ((ViewGroup) mParent).clearFocusedInCluster(); } } clearAccessibilityFocus(); destroyDrawingCache(); if (mParent instanceof View) { Loading Loading @@ -13324,7 +13332,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (((mViewFlags & VISIBILITY_MASK) == INVISIBLE)) { // root view becoming invisible shouldn't clear focus and accessibility focus if (getRootView() != this) { if (hasFocus()) clearFocus(); if (hasFocus()) { clearFocus(); if (mParent instanceof ViewGroup) { ((ViewGroup) mParent).clearFocusedInCluster(); } } clearAccessibilityFocus(); } }
core/java/android/view/ViewGroup.java +7 −0 Original line number Diff line number Diff line Loading @@ -818,6 +818,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (mFocusedInCluster != child) { return; } clearFocusedInCluster(); } /** * Removes the focusedInCluster chain from this up to the cluster containing it. */ void clearFocusedInCluster() { View top = findKeyboardNavigationCluster(); ViewParent parent = this; do { Loading