Bubble-Picker
Bubble-Picker copied to clipboard
is there a way to load image from network ?
Did you manage to find a work-around for this? This is exactly what I need. @ismailtosun @igalata Irina, can you tell me if there's a way to do this?
@ismailtosun @MilanVucic You can simply do it using glide or picasso like:
Glide.with(context)
.asBitmap()
.load(url)
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
ImageView imageView = new ImageView(context);
imageView.setImageBitmap(resource);
Drawable image = imageView.getDrawable();
item.setIcon(image);
item.setBackgroundImage(image);
}
});
The only problem with this piece of code is that this is asynchronous while getItem
is not, and thus it'll just return the item before the actual image is set as the icon. I like the idea though.
@MilanVucic Well you can use AysncTask and return PickerItem
and wait until process finish, but it will block the UI for some time.
Or @igalata should suggest more effective solution.
@ismailtosun @MilanVucic @ibrahimAlii please review my lib was developed based on this lib. I fixed this issue https://github.com/hantrungkien/Bubble-Picker