summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/InsettableFrameLayout.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2016-07-01 16:55:30 -0700
committerAdam Cohen <adamcohen@google.com>2016-07-01 16:55:52 -0700
commitd1e0cec51894ffe1971a687740c91814eb5c998f (patch)
treed91c4fabc5562251004b764474d626359d2849a8 /src/com/android/launcher3/InsettableFrameLayout.java
parentc9e71b88768639322f0821385923cb1626c10682 (diff)
downloadandroid_packages_apps_Trebuchet-d1e0cec51894ffe1971a687740c91814eb5c998f.tar.gz
android_packages_apps_Trebuchet-d1e0cec51894ffe1971a687740c91814eb5c998f.tar.bz2
android_packages_apps_Trebuchet-d1e0cec51894ffe1971a687740c91814eb5c998f.zip
Avoid unnecessary layout passes from insets callbacks if they haven't changed
Change-Id: Ia7560bd466ff47103811a1a1795af5a5a25abb59
Diffstat (limited to 'src/com/android/launcher3/InsettableFrameLayout.java')
-rw-r--r--src/com/android/launcher3/InsettableFrameLayout.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/launcher3/InsettableFrameLayout.java b/src/com/android/launcher3/InsettableFrameLayout.java
index db4d85516..154641cab 100644
--- a/src/com/android/launcher3/InsettableFrameLayout.java
+++ b/src/com/android/launcher3/InsettableFrameLayout.java
@@ -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);