Refactor InsettableFrameLayout/DragLayer and add StateListener interface.

Bug: 65387919
Change-Id: I5eb94c0f3962d44f63af3efc92d852e019bba711
This commit is contained in:
Jon Miranda
2017-11-08 14:38:23 -08:00
parent ea529083bd
commit 758d5047be
3 changed files with 38 additions and 13 deletions

View File

@@ -9,8 +9,7 @@ import android.view.ViewDebug;
import android.view.ViewGroup;
import android.widget.FrameLayout;
public class InsettableFrameLayout extends FrameLayout implements
ViewGroup.OnHierarchyChangeListener, Insettable {
public class InsettableFrameLayout extends FrameLayout implements Insettable {
@ViewDebug.ExportedProperty(category = "launcher")
protected Rect mInsets = new Rect();
@@ -21,7 +20,6 @@ public class InsettableFrameLayout extends FrameLayout implements
public InsettableFrameLayout(Context context, AttributeSet attrs) {
super(context, attrs);
setOnHierarchyChangeListener(this);
}
public void setFrameLayoutChildInsets(View child, Rect newInsets, Rect oldInsets) {
@@ -95,12 +93,8 @@ public class InsettableFrameLayout extends FrameLayout implements
}
@Override
public void onChildViewAdded(View parent, View child) {
public void onViewAdded(View child) {
super.onViewAdded(child);
setFrameLayoutChildInsets(child, mInsets, new Rect());
}
@Override
public void onChildViewRemoved(View parent, View child) {
}
}