Avoid unnecessary layout passes from insets callbacks if they haven\'t changed

am: d1e0cec518

Change-Id: I3988aeb15be5a61dfbd52b62ed35c88121e47dfb
This commit is contained in:
Adam Cohen
2016-07-02 22:13:54 +00:00
committed by android-build-merger
@@ -43,6 +43,10 @@ public class InsettableFrameLayout extends FrameLayout implements
@Override
public void setInsets(Rect insets) {
// If the insets haven't changed, this is a no-op. Avoid unnecessary layout caused by
// modifying child layout params.
if (insets.equals(mInsets)) return;
final int n = getChildCount();
for (int i = 0; i < n; i++) {
final View child = getChildAt(i);