commit | d1e0cec51894ffe1971a687740c91814eb5c998f | [log] [tgz] |
---|---|---|
author | Adam Cohen <adamcohen@google.com> | Fri Jul 01 16:55:30 2016 -0700 |
committer | Adam Cohen <adamcohen@google.com> | Fri Jul 01 16:55:52 2016 -0700 |
tree | d91c4fabc5562251004b764474d626359d2849a8 | |
parent | c9e71b88768639322f0821385923cb1626c10682 [diff] [blame] |
Avoid unnecessary layout passes from insets callbacks if they haven't changed Change-Id: Ia7560bd466ff47103811a1a1795af5a5a25abb59
diff --git a/src/com/android/launcher3/InsettableFrameLayout.java b/src/com/android/launcher3/InsettableFrameLayout.java index db4d855..154641c 100644 --- a/src/com/android/launcher3/InsettableFrameLayout.java +++ b/src/com/android/launcher3/InsettableFrameLayout.java
@@ -43,6 +43,10 @@ @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);