ImageView/ImageButton: don't use deprecated gtk_picture_set_from_pixbuf, reduce code duplication

This commit is contained in:
Mis012
2024-04-20 00:08:09 +02:00
parent 98d17ac25e
commit b52e08fd7a
6 changed files with 15 additions and 18 deletions

View File

@@ -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);

View File

@@ -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);
}