Fix CoordinatorLayout inset tests
Caused by a Rect being re-used when it shouldn't
be. Fixed for now by adding another temporary
rect.
Test: passes on 10-24
BUG: 31528047
Change-Id: I4053127a792799b4b4b4f184e8a296d4a76f0edd
diff --git a/design/src/android/support/design/widget/CoordinatorLayout.java b/design/src/android/support/design/widget/CoordinatorLayout.java
index 079a352..b32c56b 100644
--- a/design/src/android/support/design/widget/CoordinatorLayout.java
+++ b/design/src/android/support/design/widget/CoordinatorLayout.java
@@ -155,6 +155,7 @@
private final Rect mTempRect2 = new Rect();
private final Rect mTempRect3 = new Rect();
private final Rect mTempRect4 = new Rect();
+ private final Rect mTempRect5 = new Rect();
private final int[] mTempIntPair = new int[2];
private Paint mScrimPaint;
@@ -1332,7 +1333,7 @@
final Behavior behavior = lp.getBehavior();
final Rect rect = mTempRect3;
rect.setEmpty();
- final Rect bounds = mTempRect4;
+ final Rect bounds = mTempRect5;
bounds.set(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());
if (behavior != null && behavior.getInsetDodgeRect(this, child, rect)) {