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
implement ViewGroup.removeViewInLayout()
This commit is contained in:
@@ -83,7 +83,10 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void removeView(View child) {
|
||||
// This internal method is used to share code between removeView and removeViewInLayout.
|
||||
// Reusing removeView in removeViewInLayout is not possible, because e.g.
|
||||
// ViewPager overrides removeView to call removeViewInLayout
|
||||
protected void removeViewInternal(View child) {
|
||||
if (child.parent != this)
|
||||
return;
|
||||
child.parent = null;
|
||||
@@ -94,6 +97,14 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void removeView(View child) {
|
||||
removeViewInternal(child);
|
||||
}
|
||||
|
||||
public void removeViewInLayout(View child) {
|
||||
removeViewInternal(child);
|
||||
}
|
||||
|
||||
public void removeViewAt(int index) {
|
||||
removeView(children.get(index));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user