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
ImageView/ImageButton: don't use deprecated gtk_picture_set_from_pixbuf, reduce code duplication
This commit is contained in:
@@ -20,7 +20,7 @@ public class ImageButton extends ImageView {
|
||||
@Override
|
||||
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||
@Override
|
||||
protected native void native_setPixbuf(long pixbuf);
|
||||
protected native void native_setPixbuf(long widget, long pixbuf);
|
||||
@Override
|
||||
protected native void native_setDrawable(long widget, long paintable);
|
||||
protected native void native_setOnClickListener(long widget, OnClickListener l);
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ImageView extends View {
|
||||
return;
|
||||
}
|
||||
bitmap = BitmapFactory.decodeResource(Context.this_application.getResources(), resid);
|
||||
native_setPixbuf(bitmap.pixbuf);
|
||||
native_setPixbuf(widget, bitmap.pixbuf);
|
||||
}
|
||||
public void setAdjustViewBounds(boolean adjustViewBounds) {}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ImageView extends View {
|
||||
|
||||
public void setImageBitmap(Bitmap bitmap) {
|
||||
if (bitmap != null)
|
||||
native_setPixbuf(bitmap.pixbuf);
|
||||
native_setPixbuf(widget, bitmap.pixbuf);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +168,7 @@ public class ImageView extends View {
|
||||
|
||||
@Override
|
||||
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||
protected native void native_setPixbuf(long pixbuf);
|
||||
protected native void native_setPixbuf(long widget, long pixbuf);
|
||||
protected native void native_setDrawable(long widget, long paintable);
|
||||
protected native void native_setScaleType(long widget, int scale_type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user