I'm using Picasso
to load images, scale and set to listview
item. There is my code:
Picasso.with(getActivity()).load(builder.toString())
.config(Bitmap.Config.RGB_565)
.into(new Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
int width = Double.valueOf(bitmap.getWidth() * 0.75).intValue();
int height = bitmap.getHeight();
Bitmap newBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height);
imageView.setImageBitmap(newBitmap);
}
@Override
public void onBitmapFailed(Drawable errorDrawable) {
}
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) {
}
});
The problem appears when I made new Target()
object in the .into()
method, before that the speed of loaded images were very fast.
I thought what exactly slowed down my work and how to correct it? Is scale memory-expensive or this is because of new Target()
implementation at all?
Who faced with this problem? How to solve that?