Is there any easy way to tile bitmap downloaded from URL on ImageView?
Preferably using Picasso or UniversalImageLoader.
I was thinking about getting image from Picasso cache and draw on canvas, but maybe there is more elegant way?
Thanks, Bartek.
Is there any easy way to tile bitmap downloaded from URL on ImageView?
Preferably using Picasso or UniversalImageLoader.
I was thinking about getting image from Picasso cache and draw on canvas, but maybe there is more elegant way?
Thanks, Bartek.
This is what I did with Glide 4.0:
Glide.with(this).asBitmap().load(url).into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) {
BitmapDrawable bitmapDrawable = new BitmapDrawable(getResources(), resource);
bitmapDrawable.setTileModeX(Shader.TileMode.REPEAT);
bitmapDrawable.setTileModeY(Shader.TileMode.REPEAT);
myImageView.setBackground(bitmapDrawable);
}
});