Loading core/java/android/view/GhostView.java +13 −5 Original line number Original line Diff line number Diff line Loading @@ -324,19 +324,27 @@ public class GhostView extends View { final ArrayList<View> preorderedList = parent.buildOrderedChildList(); final ArrayList<View> preorderedList = parent.buildOrderedChildList(); final boolean customOrder = preorderedList == null final boolean customOrder = preorderedList == null && parent.isChildrenDrawingOrderEnabled(); && parent.isChildrenDrawingOrderEnabled(); // This default value shouldn't be used because both view and comparedWith // should be in the list. If there is an error, then just return an arbitrary // view is on top. boolean isOnTop = true; for (int i = 0; i < childrenCount; i++) { for (int i = 0; i < childrenCount; i++) { int childIndex = customOrder ? parent.getChildDrawingOrder(childrenCount, i) : i; int childIndex = customOrder ? parent.getChildDrawingOrder(childrenCount, i) : i; final View child = (preorderedList == null) final View child = (preorderedList == null) ? parent.getChildAt(childIndex) : preorderedList.get(childIndex); ? parent.getChildAt(childIndex) : preorderedList.get(childIndex); if (child == view) { if (child == view) { return false; isOnTop = false; break; } else if (child == comparedWith) { } else if (child == comparedWith) { return true; isOnTop = true; break; } } } } // Shouldn't get here. Neither of the children is in the parent. if (preorderedList != null) { // Just return an arbitrary one. preorderedList.clear(); return true; } return isOnTop; } } } } Loading
core/java/android/view/GhostView.java +13 −5 Original line number Original line Diff line number Diff line Loading @@ -324,19 +324,27 @@ public class GhostView extends View { final ArrayList<View> preorderedList = parent.buildOrderedChildList(); final ArrayList<View> preorderedList = parent.buildOrderedChildList(); final boolean customOrder = preorderedList == null final boolean customOrder = preorderedList == null && parent.isChildrenDrawingOrderEnabled(); && parent.isChildrenDrawingOrderEnabled(); // This default value shouldn't be used because both view and comparedWith // should be in the list. If there is an error, then just return an arbitrary // view is on top. boolean isOnTop = true; for (int i = 0; i < childrenCount; i++) { for (int i = 0; i < childrenCount; i++) { int childIndex = customOrder ? parent.getChildDrawingOrder(childrenCount, i) : i; int childIndex = customOrder ? parent.getChildDrawingOrder(childrenCount, i) : i; final View child = (preorderedList == null) final View child = (preorderedList == null) ? parent.getChildAt(childIndex) : preorderedList.get(childIndex); ? parent.getChildAt(childIndex) : preorderedList.get(childIndex); if (child == view) { if (child == view) { return false; isOnTop = false; break; } else if (child == comparedWith) { } else if (child == comparedWith) { return true; isOnTop = true; break; } } } } // Shouldn't get here. Neither of the children is in the parent. if (preorderedList != null) { // Just return an arbitrary one. preorderedList.clear(); return true; } return isOnTop; } } } }