summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/ViewGroup.java15
1 files changed, 3 insertions, 12 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 02011e0f306b..290585198135 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -6939,13 +6939,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (getClass() != another.getClass()) {
return 1;
}
- // First is above second.
- if (mLocation.bottom - another.mLocation.top <= 0) {
- return -1;
- }
- // First is below second.
- if (mLocation.top - another.mLocation.bottom >= 0) {
- return 1;
+ final int topDiference = mLocation.top - another.mLocation.top;
+ if (topDiference != 0) {
+ return topDiference;
}
// LTR
if (mLayoutDirection == LAYOUT_DIRECTION_LTR) {
@@ -6961,11 +6957,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
return -rightDifference;
}
}
- // Break tie by top.
- final int topDiference = mLocation.top - another.mLocation.top;
- if (topDiference != 0) {
- return topDiference;
- }
// Break tie by height.
final int heightDiference = mLocation.height() - another.mLocation.height();
if (heightDiference != 0) {