You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
View: replace custom isAttachedToWindow tracking with GTK signals
This commit is contained in:
@@ -77,8 +77,6 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
index = children.size();
|
||||
children.add(index, child);
|
||||
native_addView(widget, child.widget, index, params);
|
||||
if (isAttachedToWindow())
|
||||
child.onAttachedToWindow();
|
||||
if (onHierarchyChangeListener != null)
|
||||
onHierarchyChangeListener.onChildViewAdded(this, child);
|
||||
|
||||
@@ -111,8 +109,6 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
child.parent = null;
|
||||
children.remove(child);
|
||||
native_removeView(widget, child.widget);
|
||||
if (isAttachedToWindow())
|
||||
child.detachFromWindowInternal();
|
||||
if (onHierarchyChangeListener != null) {
|
||||
onHierarchyChangeListener.onChildViewRemoved(this, child);
|
||||
}
|
||||
@@ -136,8 +132,6 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
child.parent = null;
|
||||
it.remove();
|
||||
native_removeView(widget, child.widget);
|
||||
if (isAttachedToWindow())
|
||||
child.detachFromWindowInternal();
|
||||
if (onHierarchyChangeListener != null) {
|
||||
onHierarchyChangeListener.onChildViewRemoved(this, child);
|
||||
}
|
||||
@@ -169,8 +163,6 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
return;
|
||||
child.parent = null;
|
||||
native_removeView(widget, child.widget);
|
||||
if (isAttachedToWindow())
|
||||
child.detachFromWindowInternal();
|
||||
if (onHierarchyChangeListener != null) {
|
||||
onHierarchyChangeListener.onChildViewRemoved(this, child);
|
||||
}
|
||||
@@ -363,22 +355,6 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
|
||||
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
for (View child: children) {
|
||||
child.onAttachedToWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void detachFromWindowInternal() {
|
||||
super.detachFromWindowInternal();
|
||||
for (View child: children) {
|
||||
child.detachFromWindowInternal();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isChildrenDrawingOrderEnabled() { return false; }
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user