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
fixes to make Picasso Image Loader work
This library is used by newer NewPipe versions
This commit is contained in:
@@ -1208,7 +1208,7 @@ public final class Bitmap {
|
|||||||
* @return number of bytes between rows of the native bitmap pixels.
|
* @return number of bytes between rows of the native bitmap pixels.
|
||||||
*/
|
*/
|
||||||
public final int getRowBytes() {
|
public final int getRowBytes() {
|
||||||
return nativeRowBytes(mNativeBitmap);
|
return nativeRowBytes(pixbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1574,7 +1574,8 @@ public final class Bitmap {
|
|||||||
* and therefore is harmless.
|
* and therefore is harmless.
|
||||||
*/
|
*/
|
||||||
public void prepareToDraw() {
|
public void prepareToDraw() {
|
||||||
nativePrepareToDraw(mNativeBitmap);
|
// nativePrepareToDraw(mNativeBitmap);
|
||||||
|
System.out.println("Bitmap.prepareToDraw() called");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class BitmapFinalizer {
|
private static class BitmapFinalizer {
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import android.os.Trace;
|
|||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -478,17 +480,8 @@ public class BitmapFactory {
|
|||||||
|
|
||||||
Bitmap bm;
|
Bitmap bm;
|
||||||
|
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_GRAPHICS, "decodeBitmap");
|
InputStream stream = new ByteArrayInputStream(data, offset, length);
|
||||||
try {
|
bm = decodeStream(stream, null, opts);
|
||||||
bm = nativeDecodeByteArray(data, offset, length, opts);
|
|
||||||
|
|
||||||
if (bm == null && opts != null && opts.inBitmap != null) {
|
|
||||||
throw new IllegalArgumentException("Problem decoding into existing bitmap");
|
|
||||||
}
|
|
||||||
setDensityFromOptions(bm, opts);
|
|
||||||
} finally {
|
|
||||||
Trace.traceEnd(Trace.TRACE_TAG_GRAPHICS);
|
|
||||||
}
|
|
||||||
|
|
||||||
return bm;
|
return bm;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,6 +152,10 @@ public class Uri {
|
|||||||
return uri.getScheme();
|
return uri.getScheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return uri.getPath();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.valueOf(uri);
|
return String.valueOf(uri);
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
package android.net.http;
|
package android.net.http;
|
||||||
|
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.net.ssl.X509TrustManager;
|
import javax.net.ssl.X509TrustManager;
|
||||||
|
|
||||||
public class X509TrustManagerExtensions {
|
public class X509TrustManagerExtensions {
|
||||||
|
|
||||||
public X509TrustManagerExtensions(X509TrustManager tm) {}
|
public X509TrustManagerExtensions(X509TrustManager tm) {}
|
||||||
|
|
||||||
|
public List<X509Certificate> checkServerTrusted (X509Certificate[] chain,
|
||||||
|
String authType, String host) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,11 @@ public class ImageView extends View {
|
|||||||
return new BitmapDrawable(getContext().getResources(), bitmap);
|
return new BitmapDrawable(getContext().getResources(), bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setImageDrawable(Drawable drawable) {}
|
public void setImageDrawable(Drawable drawable) {
|
||||||
|
if (drawable instanceof BitmapDrawable) {
|
||||||
|
setImageBitmap(((BitmapDrawable) drawable).getBitmap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setImageMatrix(Matrix matrix) {}
|
public void setImageMatrix(Matrix matrix) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user