mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-29 12:48:03 +03:00
ImageButton: implement setDrawable()
This commit is contained in:
parent
93b88ad0c3
commit
35f26faa90
4 changed files with 20 additions and 0 deletions
|
@ -21,6 +21,8 @@ public class ImageButton extends ImageView {
|
|||
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||
@Override
|
||||
protected native void native_setPixbuf(long pixbuf);
|
||||
@Override
|
||||
protected native void native_setDrawable(long widget, long paintable);
|
||||
protected native void native_setOnClickListener(long widget, OnClickListener l);
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,6 +33,8 @@ public class ImageView extends View {
|
|||
if (resid != 0 && !getResources().getString(resid).endsWith(".xml")) {
|
||||
bitmap = BitmapFactory.decodeResource(getResources(), resid);
|
||||
native_setPixbuf(bitmap.pixbuf);
|
||||
} else if (resid != 0) {
|
||||
setImageDrawable(getResources().getDrawable(resid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue