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
Add some more methods needed by NewPipe. Mostly stubs
This commit is contained in:
@@ -223,14 +223,6 @@ JNIEXPORT void JNICALL Java_android_widget_AbsListView_setAdapter
|
|||||||
JNIEXPORT void JNICALL Java_android_widget_AbsListView_setItemChecked
|
JNIEXPORT void JNICALL Java_android_widget_AbsListView_setItemChecked
|
||||||
(JNIEnv *, jobject, jint, jboolean);
|
(JNIEnv *, jobject, jint, jboolean);
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: android_widget_AbsListView
|
|
||||||
* Method: setOnItemSelectedListener
|
|
||||||
* Signature: (Landroid/widget/AdapterView/OnItemSelectedListener;)V
|
|
||||||
*/
|
|
||||||
JNIEXPORT void JNICALL Java_android_widget_AbsListView_setOnItemSelectedListener
|
|
||||||
(JNIEnv *, jobject, jobject);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: android_widget_AbsListView
|
* Class: android_widget_AbsListView
|
||||||
* Method: setOnItemClickListener
|
* Method: setOnItemClickListener
|
||||||
|
|||||||
@@ -398,6 +398,12 @@ public class Activity extends ContextWrapper implements Window.Callback {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onMenuOpened(int featureId, Menu menu) {
|
||||||
|
System.out.println("onMenuOpened(" + featureId + ", " + menu + ") called");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private native void nativeFinish(long native_window);
|
private native void nativeFinish(long native_window);
|
||||||
public static native void nativeStartActivity(Activity activity);
|
public static native void nativeStartActivity(Activity activity);
|
||||||
public static native void nativeOpenURI(String uri);
|
public static native void nativeOpenURI(String uri);
|
||||||
|
|||||||
@@ -123,6 +123,12 @@ public class Dialog implements Window.Callback, DialogInterface {
|
|||||||
throw new UnsupportedOperationException("Unimplemented method 'onPanelClosed'");
|
throw new UnsupportedOperationException("Unimplemented method 'onPanelClosed'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onMenuOpened(int featureId, Menu menu) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'onMenuOpened'");
|
||||||
|
}
|
||||||
|
|
||||||
protected void onCreate (Bundle savedInstanceState) {
|
protected void onCreate (Bundle savedInstanceState) {
|
||||||
System.out.println("- onCreate - Dialog!");
|
System.out.println("- onCreate - Dialog!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ public class MediaSession {
|
|||||||
|
|
||||||
public void setCallback(Callback callback, Handler handler) {}
|
public void setCallback(Callback callback, Handler handler) {}
|
||||||
|
|
||||||
|
public void setCallback(Callback callback) {}
|
||||||
|
|
||||||
public void setMediaButtonReceiver(PendingIntent pendingIntent) {}
|
public void setMediaButtonReceiver(PendingIntent pendingIntent) {}
|
||||||
|
|
||||||
public void setActive(boolean active) {}
|
public void setActive(boolean active) {}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package android.net;
|
|||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import libcore.net.UriCodec;
|
import libcore.net.UriCodec;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
@@ -160,4 +162,15 @@ public class Uri {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return String.valueOf(uri);
|
return String.valueOf(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Uri fromFile(File file) {
|
||||||
|
Uri ret = new Uri();
|
||||||
|
ret.uri = file.toURI();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastPathSegment() {
|
||||||
|
String[] segments = uri.getPath().split("/");
|
||||||
|
return segments[segments.length - 1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,4 +7,6 @@ public class RemoteCallbackList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void finishBroadcast() {}
|
public void finishBroadcast() {}
|
||||||
|
|
||||||
|
public void kill() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,19 @@ public class Html {
|
|||||||
public static Spanned fromHtml(String source) {
|
public static Spanned fromHtml(String source) {
|
||||||
return new SpannableString(source.replace("<br/>", "\n")); // TODO when JTidy is in use: s/<br \/>//g
|
return new SpannableString(source.replace("<br/>", "\n")); // TODO when JTidy is in use: s/<br \/>//g
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String escapeHtml(CharSequence source) {
|
||||||
|
StringBuilder out = new StringBuilder(source.length());
|
||||||
|
for (int i = 0; i < source.length(); i++) {
|
||||||
|
char c = source.charAt(i);
|
||||||
|
if (c == '<' || c == '>' || c == '&' || c == '"' || c == '\'' || c > 0x7F) {
|
||||||
|
out.append("&#");
|
||||||
|
out.append((int) c);
|
||||||
|
out.append(';');
|
||||||
|
} else {
|
||||||
|
out.append(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,4 +59,8 @@ public final class Display {
|
|||||||
public void getSize(Point size) {
|
public void getSize(Point size) {
|
||||||
size.set(getWidth(), getHeight());
|
size.set(getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getRealSize(Point size) {
|
||||||
|
getSize(size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1497,6 +1497,10 @@ public class View extends Object {
|
|||||||
post(action);
|
post(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void postOnAnimationDelayed(Runnable action, long delayMillis) {
|
||||||
|
postDelayed(action, delayMillis);
|
||||||
|
}
|
||||||
|
|
||||||
public void setHorizontalScrollBarEnabled(boolean enabled) {}
|
public void setHorizontalScrollBarEnabled(boolean enabled) {}
|
||||||
|
|
||||||
public void postInvalidateOnAnimation() {
|
public void postInvalidateOnAnimation() {
|
||||||
@@ -1613,4 +1617,10 @@ public class View extends Object {
|
|||||||
public int getMeasuredWidthAndState() {
|
public int getMeasuredWidthAndState() {
|
||||||
return measuredWidth;
|
return measuredWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void forceLayout() {
|
||||||
|
requestLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeOnAttachStateChangeListener(OnAttachStateChangeListener listener) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ public class Window {
|
|||||||
public boolean onMenuItemSelected(int featureId, MenuItem item);
|
public boolean onMenuItemSelected(int featureId, MenuItem item);
|
||||||
|
|
||||||
public void onPanelClosed(int featureId, Menu menu);
|
public void onPanelClosed(int featureId, Menu menu);
|
||||||
|
|
||||||
|
public boolean onMenuOpened(int featureId, Menu menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME private
|
// FIXME private
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
package android.view.inputmethod;
|
package android.view.inputmethod;
|
||||||
|
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
public class InputMethodManager {
|
public class InputMethodManager {
|
||||||
|
|
||||||
public boolean hideSoftInputFromWindow(IBinder windowToken, int flags) {return false;}
|
public boolean hideSoftInputFromWindow(IBinder windowToken, int flags) {return false;}
|
||||||
|
|
||||||
|
public boolean showSoftInput(View view, int flags) {return false;}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import android.util.AttributeSet;
|
|||||||
|
|
||||||
public abstract class AbsListView extends AdapterView {
|
public abstract class AbsListView extends AdapterView {
|
||||||
|
|
||||||
|
public boolean mIsChildViewEnabled = false; // this field gets directly accessed by androidx DropDownListView
|
||||||
|
|
||||||
public AbsListView(Context context) {
|
public AbsListView(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
@@ -24,14 +26,23 @@ public abstract class AbsListView extends AdapterView {
|
|||||||
|
|
||||||
public native void setItemChecked(int position, boolean value);
|
public native void setItemChecked(int position, boolean value);
|
||||||
|
|
||||||
@Override
|
|
||||||
public native void setOnItemSelectedListener(OnItemSelectedListener listener);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public native void setOnItemClickListener(OnItemClickListener listener);
|
public native void setOnItemClickListener(OnItemClickListener listener);
|
||||||
|
|
||||||
public native int getCheckedItemPosition();
|
public native int getCheckedItemPosition();
|
||||||
|
|
||||||
|
public void setCacheColorHint(int color) {}
|
||||||
|
|
||||||
|
public int getListPaddingTop() {return 0;}
|
||||||
|
|
||||||
|
public int getListPaddingBottom() {return 0;}
|
||||||
|
|
||||||
|
public int pointToPosition(int x, int y) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
public interface OnScrollListener {}
|
public interface OnScrollListener {}
|
||||||
|
|
||||||
|
public interface SelectionBoundsAdjuster {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
5
src/api-impl/android/widget/HeaderViewListAdapter.java
Normal file
5
src/api-impl/android/widget/HeaderViewListAdapter.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package android.widget;
|
||||||
|
|
||||||
|
public class HeaderViewListAdapter {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package android.widget;
|
package android.widget;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
public class ListView extends AbsListView {
|
public class ListView extends AbsListView {
|
||||||
@@ -13,4 +14,8 @@ public class ListView extends AbsListView {
|
|||||||
super(context, attributeSet);
|
super(context, attributeSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getDividerHeight() {return 0;}
|
||||||
|
|
||||||
|
public Drawable getDivider() {return null;}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ package android.widget;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
public class RadioButton extends View {
|
public class RadioButton extends CompoundButton {
|
||||||
|
|
||||||
public RadioButton(Context context) {
|
public RadioButton(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
|||||||
@@ -207,4 +207,6 @@ public class TextView extends View {
|
|||||||
public int getCompoundPaddingLeft() {return 0;}
|
public int getCompoundPaddingLeft() {return 0;}
|
||||||
|
|
||||||
public int getCompoundPaddingRight() {return 0;}
|
public int getCompoundPaddingRight() {return 0;}
|
||||||
|
|
||||||
|
public void setHint(int resId) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -412,6 +412,7 @@ hax_jar = jar('hax', [
|
|||||||
'android/widget/EditText.java',
|
'android/widget/EditText.java',
|
||||||
'android/widget/Filter.java',
|
'android/widget/Filter.java',
|
||||||
'android/widget/FrameLayout.java',
|
'android/widget/FrameLayout.java',
|
||||||
|
'android/widget/HeaderViewListAdapter.java',
|
||||||
'android/widget/HorizontalScrollView.java',
|
'android/widget/HorizontalScrollView.java',
|
||||||
'android/widget/ImageButton.java',
|
'android/widget/ImageButton.java',
|
||||||
'android/widget/ImageView.java',
|
'android/widget/ImageView.java',
|
||||||
|
|||||||
Reference in New Issue
Block a user