Files
android_translation_layer/src/api-impl/android/widget/RelativeLayout.java
Julian Winkler 4d90002ec6 Simplify native interface of widget implementations
Makes it easier to overwrite behavior in subclasses. Have a fallback
implementation for ViewGroup.
Save some _GET_LONG_FIELD / _SET_LONG_FIELD calls by directly passing
the native pointers to and from native methods.
2023-08-22 15:53:09 +02:00

45 lines
1.1 KiB
Java

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 RelativeLayout extends ViewGroup {
boolean orientation;
public RelativeLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public RelativeLayout(Context context) {
super(context);
}
@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 static class LayoutParams extends ViewGroup.LayoutParams {
public LayoutParams(int width, int height) {
super(width, height);
}
public LayoutParams(int width, int height, float weight) {
super(width, height, weight);
}
public LayoutParams(ViewGroup.MarginLayoutParams source) {
super(source.width, source.height, source.weight);
}
public void addRule(int verb) {}
public void addRule(int verb, int anchor) {}
}
}