Always use addView() and removeView() implementation from ViewGroup

This makes sure, that the index argument is handled correctly everywhere
This commit is contained in:
Julian Winkler
2023-09-01 13:49:42 +02:00
parent a35879c633
commit 3b6e4dc217
10 changed files with 10 additions and 102 deletions

View File

@@ -2,9 +2,7 @@ package android.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
public class FrameLayout extends ViewGroup {
@@ -22,10 +20,6 @@ public class FrameLayout extends ViewGroup {
@Override
protected native long native_constructor(Context context, AttributeSet attrs);
@Override
protected native void native_addView(long widget, long child, int index, ViewGroup.LayoutParams params);
@Override
protected native void native_removeView(long widget, long child);
@Override
public LayoutParams generateLayoutParams(AttributeSet attrs) {

View File

@@ -2,7 +2,6 @@ package android.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
public class LinearLayout extends ViewGroup {
@@ -19,10 +18,6 @@ public class LinearLayout extends ViewGroup {
@Override
protected native long native_constructor(Context context, AttributeSet attrs);
@Override
protected native void native_addView(long widget, long child, int index, ViewGroup.LayoutParams params);
@Override
protected native void native_removeView(long widget, long child);
public native void setOrientation(int orientation);
public void setWeightSum(float weightSum) {}

View File

@@ -2,9 +2,7 @@ package android.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
public class ScrollView extends ViewGroup {
public ScrollView(Context context, AttributeSet attrs) {
@@ -17,10 +15,6 @@ public class ScrollView extends ViewGroup {
@Override
protected native long native_constructor(Context context, AttributeSet attrs);
@Override
protected native void native_addView(long widget, long child, int index, ViewGroup.LayoutParams params);
@Override
protected native void native_removeView(long widget, long child);
public void setFillViewport(boolean fillViewport) {}
}