From 07b6929cd94e6d55fb660f85baf1df840de48f46 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Mon, 8 Jan 2018 14:19:34 -0800 Subject: Removing layout handling in DeviceProfile and moving it to individual views Bug: 71709920 Change-Id: I8300fa7a84b31898bdb135d774cca576d2928525 --- src/com/android/launcher3/InsettableFrameLayout.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/com/android/launcher3/InsettableFrameLayout.java') diff --git a/src/com/android/launcher3/InsettableFrameLayout.java b/src/com/android/launcher3/InsettableFrameLayout.java index 60f5ca292..baf3328ea 100644 --- a/src/com/android/launcher3/InsettableFrameLayout.java +++ b/src/com/android/launcher3/InsettableFrameLayout.java @@ -97,4 +97,14 @@ public class InsettableFrameLayout extends FrameLayout implements Insettable { super.onViewAdded(child); setFrameLayoutChildInsets(child, mInsets, new Rect()); } + + public static void dispatchInsets(ViewGroup parent, Rect insets) { + final int n = parent.getChildCount(); + for (int i = 0; i < n; i++) { + final View child = parent.getChildAt(i); + if (child instanceof Insettable) { + ((Insettable) child).setInsets(insets); + } + } + } } -- cgit v1.2.3