You can do it by 2 ways:java
loadImage(...)
and set layout background in listener (ImageLoadingListener.onLoadingComplete(..., Bitmap loadedImage, ...)
)ImageAware
which will wrap LinearLayout
(like ImageViewAware
). At this moment you can find ViewAware
class in repository which does the main work for it. You should just extend it like this:public class BgViewAware extends ViewAware { public BgViewAware(View view) { super(view); } public BgViewAware(View view, boolean checkActualViewSize) { super(view, checkActualViewSize); } @Override protected void setImageDrawableInto(Drawable drawable, View view) { view.setBackgroundDrawable(drawable); } @Override protected void setImageBitmapInto(Bitmap bitmap, View view) { view.setBackgroundDrawable(new BitmapDrawable(view.getResources(), bitmap)); } }
And then you can pass this BgViewAware
(new BgViewAware(linearLayout)
) into displayImage(...)
method.
But ViewAware
class isn't released yet. It will be available in UIL 1.9.2.git
https://github.com/nostra13/Android-Universal-Image-Loader/issues/594github