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
src/api-impl: misc stubbing
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
#undef android_app_NativeActivity_MODE_PRIVATE
|
||||||
|
#define android_app_NativeActivity_MODE_PRIVATE 0L
|
||||||
/*
|
/*
|
||||||
* Class: android_app_NativeActivity
|
* Class: android_app_NativeActivity
|
||||||
* Method: loadNativeCode
|
* Method: loadNativeCode
|
||||||
|
|||||||
@@ -5,4 +5,6 @@ public interface DialogInterface {
|
|||||||
}
|
}
|
||||||
public interface OnClickListener {
|
public interface OnClickListener {
|
||||||
}
|
}
|
||||||
|
public interface OnShowListener {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
public class Uri {
|
public class Uri {
|
||||||
|
public static Uri parse(String s) {
|
||||||
|
return new Uri();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ import android.view.MotionEvent;
|
|||||||
|
|
||||||
import android.view.SurfaceHolder;
|
import android.view.SurfaceHolder;
|
||||||
|
|
||||||
public class GLSurfaceView extends View implements SurfaceHolder.Callback { // TODO: have this extend SurfaceView once that one is implemented?
|
import android.view.Surface;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
|
||||||
|
public class GLSurfaceView extends View implements SurfaceHolder.Callback { // TODO: have this extend SurfaceView?
|
||||||
EGLContextFactory context_factory = new default_ContextFactory();
|
EGLContextFactory context_factory = new default_ContextFactory();
|
||||||
EGLConfigChooser config_chooser = new boolean_ConfigChooser(true);
|
EGLConfigChooser config_chooser = new boolean_ConfigChooser(true);
|
||||||
EGL10 java_egl_wrapper;
|
EGL10 java_egl_wrapper;
|
||||||
@@ -146,6 +150,26 @@ public class GLSurfaceView extends View implements SurfaceHolder.Callback { // T
|
|||||||
r.run();
|
r.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class DummySurfaceHolder implements SurfaceHolder {
|
||||||
|
public void addCallback(Callback callback) {}
|
||||||
|
public void removeCallback(Callback callback) {}
|
||||||
|
public boolean isCreating() {return false;}
|
||||||
|
public void setType(int type) {}
|
||||||
|
public void setFixedSize(int width, int height) {}
|
||||||
|
public void setSizeFromLayout() {}
|
||||||
|
public void setFormat(int format) {}
|
||||||
|
public void setKeepScreenOn(boolean screenOn) {}
|
||||||
|
public Canvas lockCanvas() {return null;}
|
||||||
|
public Canvas lockCanvas(Rect dirty) {return null;}
|
||||||
|
public void unlockCanvasAndPost(Canvas canvas) {}
|
||||||
|
public Rect getSurfaceFrame() {return null;}
|
||||||
|
public Surface getSurface() {return null;}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SurfaceHolder getHolder() {
|
||||||
|
return (SurfaceHolder) new DummySurfaceHolder();
|
||||||
|
}
|
||||||
|
|
||||||
private static class boolean_ConfigChooser implements GLSurfaceView.EGLConfigChooser {
|
private static class boolean_ConfigChooser implements GLSurfaceView.EGLConfigChooser {
|
||||||
// TODO - what happens if we actually allow for 16 bits per color?
|
// TODO - what happens if we actually allow for 16 bits per color?
|
||||||
private static int[] config_attribs_no_depth = {EGL10.EGL_RED_SIZE, 8, EGL10.EGL_GREEN_SIZE, 8, EGL10.EGL_BLUE_SIZE, 8, EGL10.EGL_ALPHA_SIZE, 0, EGL10.EGL_DEPTH_SIZE, 0, EGL10.EGL_STENCIL_SIZE, 0, EGL10.EGL_NONE};
|
private static int[] config_attribs_no_depth = {EGL10.EGL_RED_SIZE, 8, EGL10.EGL_GREEN_SIZE, 8, EGL10.EGL_BLUE_SIZE, 8, EGL10.EGL_ALPHA_SIZE, 0, EGL10.EGL_DEPTH_SIZE, 0, EGL10.EGL_STENCIL_SIZE, 0, EGL10.EGL_NONE};
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ public final class Log {
|
|||||||
* @return Whether or not that this is allowed to be logged.
|
* @return Whether or not that this is allowed to be logged.
|
||||||
* @throws IllegalArgumentException is thrown if the tag.length() > 23.
|
* @throws IllegalArgumentException is thrown if the tag.length() > 23.
|
||||||
*/
|
*/
|
||||||
public static native boolean isLoggable(String tag, int level);
|
public static /*native*/ boolean isLoggable(String tag, int level) {return true;} // should be fiiiine?
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Send a {@link #WARN} log message and log the exception.
|
* Send a {@link #WARN} log message and log the exception.
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import android.content.res.Resources;
|
|||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
|
|
||||||
|
import android.os.IBinder;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class View extends Object {
|
public class View extends Object {
|
||||||
@@ -858,4 +860,16 @@ public class View extends Object {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setOnGenericMotionListener (View.OnGenericMotionListener l) {}
|
public void setOnGenericMotionListener (View.OnGenericMotionListener l) {}
|
||||||
|
|
||||||
|
public IBinder getWindowToken() {
|
||||||
|
return new IBinder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getLocationInWindow(int[] xxx) {}
|
||||||
|
|
||||||
|
public void addOnAttachStateChangeListener(OnAttachStateChangeListener l) {}
|
||||||
|
|
||||||
|
public Context getContext() {
|
||||||
|
return this.context;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,12 @@ public class ImageView extends View {
|
|||||||
native_constructor(context);
|
native_constructor(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ImageView(Context context, AttributeSet attrs, int xxx) {
|
||||||
|
super(context);
|
||||||
|
|
||||||
|
native_constructor(context);
|
||||||
|
}
|
||||||
|
|
||||||
private native void native_constructor(AttributeSet attrs);
|
private native void native_constructor(AttributeSet attrs);
|
||||||
private native void native_constructor(Context context);
|
private native void native_constructor(Context context);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user