am d0b85cc7: am 5f8406a0: am f9930189: Fix a parallax/view visibility bug in SlidingPaneLayout
* commit 'd0b85cc73723726aa78f43dcef2c97cdbaa4ee08':
Fix a parallax/view visibility bug in SlidingPaneLayout
diff --git a/v4/java/android/support/v4/widget/SlidingPaneLayout.java b/v4/java/android/support/v4/widget/SlidingPaneLayout.java
index 335474e..40200bc 100644
--- a/v4/java/android/support/v4/widget/SlidingPaneLayout.java
+++ b/v4/java/android/support/v4/widget/SlidingPaneLayout.java
@@ -346,6 +346,10 @@
}
void updateObscuredViewsVisibility(View panel) {
+ final int leftBound = getPaddingLeft();
+ final int rightBound = getWidth() - getPaddingRight();
+ final int topBound = getPaddingTop();
+ final int bottomBound = getHeight() - getPaddingBottom();
final int left;
final int right;
final int top;
@@ -367,9 +371,13 @@
break;
}
+ final int clampedChildLeft = Math.max(leftBound, child.getLeft());
+ final int clampedChildTop = Math.max(topBound, child.getTop());
+ final int clampedChildRight = Math.min(rightBound, child.getRight());
+ final int clampedChildBottom = Math.min(bottomBound, child.getBottom());
final int vis;
- if (child.getLeft() >= left && child.getTop() >= top &&
- child.getRight() <= right && child.getBottom() <= bottom) {
+ if (clampedChildLeft >= left && clampedChildTop >= top &&
+ clampedChildRight <= right && clampedChildBottom <= bottom) {
vis = INVISIBLE;
} else {
vis = VISIBLE;