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: add misc stubs/impls
This commit is contained in:
@@ -41,6 +41,7 @@ public class Activity extends ContextWrapper implements Window.Callback {
|
||||
private boolean paused = false;
|
||||
private CharSequence title = null;
|
||||
List<Fragment> fragments = new ArrayList<>();
|
||||
boolean destroyed = false;
|
||||
|
||||
/**
|
||||
* Helper function to be called from native code to construct main activity
|
||||
@@ -204,6 +205,7 @@ public class Activity extends ContextWrapper implements Window.Callback {
|
||||
fragment.onDestroy();
|
||||
}
|
||||
|
||||
destroyed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -482,6 +484,10 @@ public class Activity extends ContextWrapper implements Window.Callback {
|
||||
return true; // FIXME?
|
||||
}
|
||||
|
||||
public boolean isDestroyed() {
|
||||
return destroyed;
|
||||
}
|
||||
|
||||
private native void nativeFinish(long native_window);
|
||||
public static native void nativeRecreateActivity(Activity activity);
|
||||
public static native void nativeStartActivity(Activity activity);
|
||||
|
||||
@@ -9,9 +9,10 @@ import android.media.AudioAttributes;
|
||||
import android.media.session.MediaSession;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
public class Notification {
|
||||
public class Notification implements Parcelable {
|
||||
|
||||
public static final AudioAttributes AUDIO_ATTRIBUTES_DEFAULT = new AudioAttributes();
|
||||
|
||||
|
||||
@@ -22,4 +22,7 @@ public abstract class Service extends Context {
|
||||
System.out.println("stopForeground(" + remove + ") called");
|
||||
}
|
||||
|
||||
public Application getApplication() {
|
||||
return this_application;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,5 @@ public class Shader {
|
||||
REPEAT
|
||||
}
|
||||
|
||||
public void setLocalMatrix(Matrix matrix) {}
|
||||
}
|
||||
|
||||
@@ -1804,7 +1804,8 @@ public final class MotionEvent extends InputEvent {
|
||||
* a stream of position events.
|
||||
*/
|
||||
public final long getDownTime() {
|
||||
return nativeGetDownTimeNanos(mNativePtr) / NS_PER_MS;
|
||||
return getEventTime(); // FIXME?
|
||||
// return nativeGetDownTimeNanos(mNativePtr) / NS_PER_MS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1489,11 +1489,6 @@ public class View implements Drawable.Callback {
|
||||
|
||||
public void clearFocus() {}
|
||||
|
||||
public void setRotation(float rotation) {}
|
||||
|
||||
public void setScaleX(float scaleX) {}
|
||||
public void setScaleY(float scaleY) {}
|
||||
|
||||
public static View inflate(Context context, int resource, ViewGroup root) {
|
||||
LayoutInflater factory = LayoutInflater.from(context);
|
||||
return factory.inflate(resource, root);
|
||||
@@ -1734,20 +1729,32 @@ public class View implements Drawable.Callback {
|
||||
|
||||
public void getWindowVisibleDisplayFrame(Rect rect) {}
|
||||
|
||||
public void setRotation(float rotation) {}
|
||||
public void setRotationX(float deg) {}
|
||||
|
||||
public void setRotationY(float deg) {}
|
||||
|
||||
public float getRotationX() {return 0.f;}
|
||||
public float getRotationY() {return 0.f;}
|
||||
|
||||
public void setScaleX(float scaleX) {}
|
||||
public void setScaleY(float scaleY) {}
|
||||
|
||||
public float getScaleX() {return 1.f;}
|
||||
public float getScaleY() {return 1.f;}
|
||||
|
||||
public void setPivotX(float pivot_x) {}
|
||||
public void setPivotY(float pivot_y) {}
|
||||
|
||||
public float getPivotX() {return 0.f;}
|
||||
public float getPivotY() {return 0.f;}
|
||||
|
||||
public float getTranslationZ() {return 0.f;}
|
||||
|
||||
public void setTranslationZ(float translationZ) {}
|
||||
|
||||
public int getWindowSystemUiVisibility() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setScrollIndicators(int indicators, int mask) {}
|
||||
}
|
||||
|
||||
5
src/api-impl/android/view/ViewAnimationUtils.java
Normal file
5
src/api-impl/android/view/ViewAnimationUtils.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package android.view;
|
||||
|
||||
public class ViewAnimationUtils {
|
||||
|
||||
}
|
||||
@@ -106,4 +106,5 @@ public class Window {
|
||||
return new WindowManagerImpl();
|
||||
}
|
||||
|
||||
public void setSoftInputMode(int dummy) {}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,48 @@ public class WindowInsets {
|
||||
public WindowInsets consumeSystemWindowInsets() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public WindowInsets replaceSystemWindowInsets(int left, int top, int right, int bottom) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getSystemWindowInsetLeft() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getSystemWindowInsetTop() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getSystemWindowInsetRight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getSystemWindowInsetBottom() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getStableInsetLeft() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getStableInsetTop() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getStableInsetRight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getStableInsetBottom() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean isRound() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isConsumed() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package android.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public class ExpandableListView extends ListView {
|
||||
|
||||
@@ -16,4 +17,10 @@ public class ExpandableListView extends ListView {
|
||||
public static int getPackedPositionGroup(long packedPosition) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setHeaderDividersEnabled(boolean enabled) {}
|
||||
|
||||
public static interface OnChildClickListener {
|
||||
abstract boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,5 @@ public class HorizontalScrollView extends FrameLayout {
|
||||
|
||||
public void smoothScrollTo(int x, int y) {}
|
||||
|
||||
public void setFillViewport(boolean fillViewport) {}
|
||||
}
|
||||
|
||||
@@ -262,4 +262,10 @@ public class TextView extends View {
|
||||
public Drawable[] getCompoundDrawablesRelative() {return new Drawable[4];}
|
||||
|
||||
public Drawable[] getCompoundDrawables() {return new Drawable[4];}
|
||||
|
||||
public void setTextAppearance(int dummy) {}
|
||||
|
||||
public int length() {
|
||||
return getText().length();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,6 +372,7 @@ hax_jar = jar('hax', [
|
||||
'android/util/XmlPullAttributes.java',
|
||||
'android/view/AbsSavedState.java',
|
||||
'android/view/ActionMode.java',
|
||||
'android/view/ViewAnimationUtils.java',
|
||||
'android/view/Choreographer.java',
|
||||
'android/view/ContextThemeWrapper.java',
|
||||
'android/view/Display.java',
|
||||
|
||||
Reference in New Issue
Block a user