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 lots of java APIs needed for Whatsapp
This commit is contained in:
@@ -5,7 +5,6 @@ import android.content.res.ColorStateList;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
@@ -17,6 +16,7 @@ public class ImageView extends View {
|
||||
|
||||
private Bitmap bitmap = null;
|
||||
private ScaleType scaleType = ScaleType.FIT_CENTER;
|
||||
private Drawable drawable = null;
|
||||
|
||||
public ImageView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
@@ -56,20 +56,11 @@ public class ImageView extends View {
|
||||
}
|
||||
|
||||
public Drawable getDrawable() {
|
||||
if(bitmap == null) {
|
||||
return new Drawable() {
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'draw'");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return new BitmapDrawable(getContext().getResources(), bitmap);
|
||||
return drawable;
|
||||
}
|
||||
|
||||
public void setImageDrawable(Drawable drawable) {
|
||||
this.drawable = drawable;
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
setImageBitmap(((BitmapDrawable) drawable).getBitmap());
|
||||
} else if (drawable != null && drawable.paintable != 0) {
|
||||
|
||||
Reference in New Issue
Block a user