Loading core/java/android/view/View.java +11 −5 Original line number Original line Diff line number Diff line Loading @@ -25824,6 +25824,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param selected true if the view must be selected, false otherwise * @param selected true if the view must be selected, false otherwise */ */ public void setSelected(boolean selected) { public void setSelected(boolean selected) { setSelected(selected, true); } void setSelected(boolean selected, boolean sendAccessibilityEvent) { //noinspection DoubleNegation //noinspection DoubleNegation if (((mPrivateFlags & PFLAG_SELECTED) != 0) != selected) { if (((mPrivateFlags & PFLAG_SELECTED) != 0) != selected) { mPrivateFlags = (mPrivateFlags & ~PFLAG_SELECTED) | (selected ? PFLAG_SELECTED : 0); mPrivateFlags = (mPrivateFlags & ~PFLAG_SELECTED) | (selected ? PFLAG_SELECTED : 0); Loading @@ -25831,6 +25835,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, invalidate(true); invalidate(true); refreshDrawableState(); refreshDrawableState(); dispatchSetSelected(selected); dispatchSetSelected(selected); if (sendAccessibilityEvent) { if (selected) { if (selected) { sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); } else { } else { Loading @@ -25839,6 +25844,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } } } } } } /** /** * Dispatch setSelected to all of this View's children. * Dispatch setSelected to all of this View's children. core/java/android/view/ViewGroup.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -4631,7 +4631,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final View[] children = mChildren; final View[] children = mChildren; final int count = mChildrenCount; final int count = mChildrenCount; for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) { children[i].setSelected(selected); children[i].setSelected(selected, false); } } } } Loading Loading
core/java/android/view/View.java +11 −5 Original line number Original line Diff line number Diff line Loading @@ -25824,6 +25824,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param selected true if the view must be selected, false otherwise * @param selected true if the view must be selected, false otherwise */ */ public void setSelected(boolean selected) { public void setSelected(boolean selected) { setSelected(selected, true); } void setSelected(boolean selected, boolean sendAccessibilityEvent) { //noinspection DoubleNegation //noinspection DoubleNegation if (((mPrivateFlags & PFLAG_SELECTED) != 0) != selected) { if (((mPrivateFlags & PFLAG_SELECTED) != 0) != selected) { mPrivateFlags = (mPrivateFlags & ~PFLAG_SELECTED) | (selected ? PFLAG_SELECTED : 0); mPrivateFlags = (mPrivateFlags & ~PFLAG_SELECTED) | (selected ? PFLAG_SELECTED : 0); Loading @@ -25831,6 +25835,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, invalidate(true); invalidate(true); refreshDrawableState(); refreshDrawableState(); dispatchSetSelected(selected); dispatchSetSelected(selected); if (sendAccessibilityEvent) { if (selected) { if (selected) { sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); } else { } else { Loading @@ -25839,6 +25844,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } } } } } } /** /** * Dispatch setSelected to all of this View's children. * Dispatch setSelected to all of this View's children.
core/java/android/view/ViewGroup.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -4631,7 +4631,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final View[] children = mChildren; final View[] children = mChildren; final int count = mChildrenCount; final int count = mChildrenCount; for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) { children[i].setSelected(selected); children[i].setSelected(selected, false); } } } } Loading