mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Refactor InsettableFrameLayout/DragLayer and add StateListener interface.
Bug: 65387919 Change-Id: I5eb94c0f3962d44f63af3efc92d852e019bba711
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user