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
some fixes to make NewPipe not crash when layouting
This commit is contained in:
@@ -56,7 +56,7 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
addView(child, new LayoutParams(width, height));
|
||||
}
|
||||
|
||||
public void addView(View child, int index, LayoutParams params) {
|
||||
private void addViewInternal(View child, int index, LayoutParams params) {
|
||||
if (child.parent == this)
|
||||
return;
|
||||
if (params != null) {
|
||||
@@ -67,6 +67,15 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
native_addView(widget, child.widget, index, params);
|
||||
}
|
||||
|
||||
public void addView(View child, int index, LayoutParams params) {
|
||||
addViewInternal(child, index, params);
|
||||
}
|
||||
|
||||
protected boolean addViewInLayout(View child, int index, LayoutParams params) {
|
||||
addViewInternal(child, index, params);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void removeView(View child) {
|
||||
if (child.parent != this)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user