misc stubbing

This commit is contained in:
Mis012
2022-11-24 23:10:27 +01:00
parent 9db07691fe
commit 52ba443401
16 changed files with 114 additions and 30 deletions

View File

@@ -0,0 +1,5 @@
package android.view;
public final class Choreographer {
public static interface FrameCallback {}
}

View File

@@ -3,6 +3,7 @@ package android.view;
import android.util.AttributeSet;
import android.util.LayoutDirection;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Rect;
import android.graphics.Canvas;
@@ -746,6 +747,10 @@ public class View extends Object {
native_set_size_request(MeasureSpec.getSize(measuredWidth), MeasureSpec.getSize(measuredHeight));
}
public Resources getResources() {
return Context.this_application.getResources();
}
public native void setGravity(int gravity);
public native void setOnTouchListener(OnTouchListener l);
public native void setOnClickListener(OnClickListener l);
@@ -758,6 +763,12 @@ public class View extends Object {
// --- stubs
public void setContentDescription(CharSequence contentDescription) {
System.out.println("setContentDescription called with: >"+contentDescription+"<");
}
public void setId(int id) {}
public void setOnKeyListener(OnKeyListener l) {}
public void setFocusable(boolean focusable) {}

View File

@@ -49,13 +49,8 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
public native void addView(View child, int index, LayoutParams params);
public native void removeView(View view);/* {
System.out.println("NOT_IMPLEMENTED: ViewGroup.removeView: Gtk4 doesn't have a generic function for removing a child of GtkView, so you must override this function in the actual widget's class");
}*/
public native void removeAllViews();/* {
System.out.println("NOT_IMPLEMENTED: ViewGroup.removeAllViews: Gtk4 doesn't have a generic function for removing a child of GtkView, so you must override this function in the actual widget's class");
new Exception().printStackTrace();
}*/
public native void removeView(View view);
public native void removeAllViews();
public View getChildAt(int index) {
return children.get(index);
@@ -67,6 +62,10 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
return new LayoutParams(/*getContext(), attrs*/);
}
public void bringChildToFront(View child) {
// TODO: actually implement this (might make sense to implement it in the subclasses instead), when applicable
}
public static class LayoutParams {
public static final int FILL_PARENT = -1;
public static final int MATCH_PARENT = -1;