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
api-impl,libandroid: Add some stubs, mostly
This commit is contained in:
@@ -14,6 +14,10 @@ public class AlertDialog extends Dialog implements DialogInterface {
|
|||||||
super(context, 0);
|
super(context, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AlertDialog(Context context, int themeResId) {
|
||||||
|
super(context, themeResId);
|
||||||
|
}
|
||||||
|
|
||||||
public void setMessage(CharSequence message) {
|
public void setMessage(CharSequence message) {
|
||||||
System.out.println("AlertDialog setMessage called with: '" + message + "'");
|
System.out.println("AlertDialog setMessage called with: '" + message + "'");
|
||||||
nativeSetMessage(nativePtr, String.valueOf(message));
|
nativeSetMessage(nativePtr, String.valueOf(message));
|
||||||
@@ -41,6 +45,12 @@ public class AlertDialog extends Dialog implements DialogInterface {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AlertDialog.Builder setNegativeButton (CharSequence text, DialogInterface.OnClickListener listener) {
|
||||||
|
System.out.println("AlertDialog.Builder setNegativeButton called with text: '" + text + "'");
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public AlertDialog.Builder setCancelable(boolean cancelable) {
|
public AlertDialog.Builder setCancelable(boolean cancelable) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ public class Dialog {
|
|||||||
nativeSetTitle(nativePtr, String.valueOf(title));
|
nativeSetTitle(nativePtr, String.valueOf(title));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setTitle(int titleId) {
|
||||||
|
nativeSetTitle(nativePtr, context.getString(titleId));
|
||||||
|
}
|
||||||
|
|
||||||
public void setOwnerActivity(Activity activity) {}
|
public void setOwnerActivity(Activity activity) {}
|
||||||
|
|
||||||
public void setCancelable(boolean cancelable) {}
|
public void setCancelable(boolean cancelable) {}
|
||||||
|
|||||||
@@ -2,9 +2,15 @@ package android.app;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
public class ProgressDialog extends Dialog {
|
public class ProgressDialog extends AlertDialog {
|
||||||
|
|
||||||
|
public ProgressDialog(Context context) {
|
||||||
|
super(context, 0);
|
||||||
|
}
|
||||||
|
|
||||||
public ProgressDialog(Context context, int themeResId) {
|
public ProgressDialog(Context context, int themeResId) {
|
||||||
super(context, themeResId);
|
super(context, themeResId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setIndeterminate(boolean indeterminate) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,6 +164,18 @@ public class Intent {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Intent putExtras (Intent src) {
|
||||||
|
// FIXME HACK
|
||||||
|
this.extras = src.getExtras();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Intent putExtras (Bundle extras) {
|
||||||
|
// FIXME HACK
|
||||||
|
this.extras = extras;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Intent setClass(Context packageContext, Class<?> cls) {
|
public Intent setClass(Context packageContext, Class<?> cls) {
|
||||||
setComponent(new ComponentName(packageContext, cls));
|
setComponent(new ComponentName(packageContext, cls));
|
||||||
return this;
|
return this;
|
||||||
@@ -177,6 +189,13 @@ public class Intent {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDataString () {
|
||||||
|
if (data == null)
|
||||||
|
return "";
|
||||||
|
|
||||||
|
return data.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean getBooleanExtra(String name, boolean defaultValue) {
|
public boolean getBooleanExtra(String name, boolean defaultValue) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package android.hardware.input;
|
package android.hardware.input;
|
||||||
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.view.InputDevice;
|
||||||
|
|
||||||
public class InputManager {
|
public class InputManager {
|
||||||
public static interface InputDeviceListener {
|
public static interface InputDeviceListener {
|
||||||
@@ -11,4 +12,13 @@ public class InputManager {
|
|||||||
|
|
||||||
public void registerInputDeviceListener(InputManager.InputDeviceListener listener, Handler handler) {
|
public void registerInputDeviceListener(InputManager.InputDeviceListener listener, Handler handler) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[] getInputDeviceIds () {
|
||||||
|
return InputDevice.getDeviceIds();
|
||||||
|
}
|
||||||
|
|
||||||
|
public InputDevice getInputDevice (int id) {
|
||||||
|
return InputDevice.getDevice(id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,55 @@
|
|||||||
package android.view;
|
package android.view;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class InputDevice {
|
public class InputDevice {
|
||||||
|
|
||||||
public static final int SOURCE_CLASS_BUTTON = 0x00000001;
|
public static final int SOURCE_CLASS_BUTTON = 0x00000001;
|
||||||
|
public static final int SOURCE_CLASS_JOYSTICK = 0x00000010;
|
||||||
|
public static final int SOURCE_CLASS_GAMEPAD = 0x00000400 | SOURCE_CLASS_BUTTON;
|
||||||
public static final int SOURCE_KEYBOARD = 0x00000100 | SOURCE_CLASS_BUTTON;
|
public static final int SOURCE_KEYBOARD = 0x00000100 | SOURCE_CLASS_BUTTON;
|
||||||
|
|
||||||
|
|
||||||
public static int[] getDeviceIds() {
|
public static int[] getDeviceIds() {
|
||||||
return new int[] {0}; // might work?
|
return new int[] {0}; // might work?
|
||||||
}
|
}
|
||||||
|
|
||||||
public static InputDevice getDevice(int id) {
|
public static InputDevice getDevice(int id) {
|
||||||
return null;
|
return new InputDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FIXME: We pretend we can do literally everything here...
|
||||||
|
*/
|
||||||
|
|
||||||
|
public boolean[] hasKeys(int... keys) {
|
||||||
|
boolean[] ret = new boolean[keys.length];
|
||||||
|
for (int i = 0; i < keys.length; i++) {
|
||||||
|
ret[i] = true;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<InputDevice.MotionRange>getMotionRanges() {
|
||||||
|
MotionRange[] ranges = new MotionRange[32];
|
||||||
|
|
||||||
|
for (int i = 0; i < ranges.length; i++) {
|
||||||
|
ranges[i] = new MotionRange(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ArrayList<InputDevice.MotionRange>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MotionRange {
|
||||||
|
int axis;
|
||||||
|
|
||||||
|
public MotionRange(int axis) {
|
||||||
|
this.axis = axis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAxis() {
|
||||||
|
return this.axis;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package android.view;
|
package android.view;
|
||||||
|
|
||||||
|
import android.view.SurfaceHolder;
|
||||||
|
|
||||||
public class Window {
|
public class Window {
|
||||||
public static final int FEATURE_OPTIONS_PANEL = 0;
|
public static final int FEATURE_OPTIONS_PANEL = 0;
|
||||||
|
|
||||||
@@ -72,4 +74,6 @@ public class Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setAttributes(WindowManager.LayoutParams params) {}
|
public void setAttributes(WindowManager.LayoutParams params) {}
|
||||||
|
|
||||||
|
public void takeSurface(SurfaceHolder.Callback2 callback) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -538,3 +538,10 @@ XrResult bionic_xrCreateInstance(XrInstanceCreateInfo *createInfo, XrInstance *i
|
|||||||
createInfo->enabledExtensionNames = enabled_exts;
|
createInfo->enabledExtensionNames = enabled_exts;
|
||||||
return xr_lazy_call("xrCreateInstance", createInfo, instance);
|
return xr_lazy_call("xrCreateInstance", createInfo, instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef void* ANativeActivity;
|
||||||
|
|
||||||
|
void ANativeActivity_setWindowFormat(ANativeActivity *activity, int32_t format)
|
||||||
|
{
|
||||||
|
printf("STUB: %s called\n", __func__);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user