call View.onAttachedToWindow() method

This commit is contained in:
Julian Winkler
2023-10-08 17:51:41 +02:00
parent f4251af2a2
commit 520d153c55
8 changed files with 43 additions and 7 deletions

View File

@@ -75,6 +75,9 @@ 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();
}
requestLayout();
}
@@ -291,6 +294,14 @@ 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();
}
}
public static class LayoutParams {
public static final int FILL_PARENT = -1;
public static final int MATCH_PARENT = -1;