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 stubs to make NewPipe video player work again
This commit is contained in:
@@ -42,6 +42,9 @@ JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1bitmap_1from_1path(
|
|||||||
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth(JNIEnv *env, jobject this)
|
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth(JNIEnv *env, jobject this)
|
||||||
{
|
{
|
||||||
GdkPixbuf *pixbuf = _PTR(_GET_LONG_FIELD(this, "pixbuf"));
|
GdkPixbuf *pixbuf = _PTR(_GET_LONG_FIELD(this, "pixbuf"));
|
||||||
|
if (!pixbuf) {
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
|
||||||
return gdk_pixbuf_get_width(pixbuf);
|
return gdk_pixbuf_get_width(pixbuf);
|
||||||
}
|
}
|
||||||
@@ -49,6 +52,9 @@ JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth(JNIEnv *env, jobjec
|
|||||||
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getHeight(JNIEnv *env, jobject this)
|
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getHeight(JNIEnv *env, jobject this)
|
||||||
{
|
{
|
||||||
GdkPixbuf *pixbuf = _PTR(_GET_LONG_FIELD(this, "pixbuf"));
|
GdkPixbuf *pixbuf = _PTR(_GET_LONG_FIELD(this, "pixbuf"));
|
||||||
|
if (!pixbuf) {
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
|
||||||
return gdk_pixbuf_get_height(pixbuf);
|
return gdk_pixbuf_get_height(pixbuf);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -719,4 +719,8 @@ public class TypedArray {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return Arrays.toString(mData);
|
return Arrays.toString(mData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getChangingConfigurations() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1251,7 +1251,8 @@ public final class Bitmap {
|
|||||||
* that config, otherwise return null.
|
* that config, otherwise return null.
|
||||||
*/
|
*/
|
||||||
public final Config getConfig() {
|
public final Config getConfig() {
|
||||||
return Config.nativeToConfig(nativeConfig(mNativeBitmap));
|
// return Config.nativeToConfig(nativeConfig(mNativeBitmap));
|
||||||
|
return Config.ARGB_8888;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,10 +13,12 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.content.res.XmlResourceParser;
|
import android.content.res.XmlResourceParser;
|
||||||
|
import android.content.res.Resources.Theme;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.ColorFilter;
|
import android.graphics.ColorFilter;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
|
import android.util.AttributeSet;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
|
|
||||||
public class Drawable {
|
public class Drawable {
|
||||||
@@ -131,6 +133,10 @@ public class Drawable {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Drawable createFromXmlInner(Resources resources, XmlPullParser parser, AttributeSet attrs, Theme theme) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static Drawable createFromResourceStream(Resources resources, TypedValue value, InputStream is, String file,
|
public static Drawable createFromResourceStream(Resources resources, TypedValue value, InputStream is, String file,
|
||||||
Object object) {
|
Object object) {
|
||||||
Path path = Paths.get(android.os.Environment.getExternalStorageDirectory().getPath(), file);
|
Path path = Paths.get(android.os.Environment.getExternalStorageDirectory().getPath(), file);
|
||||||
|
|||||||
Reference in New Issue
Block a user