android - Is there any way from which we can detect images are loading from cache in picasso? -
as title suggest want check whether images loading cache or not.
i've done couldn't succeeded.
picasso.with(getapplicationcontext()) .load(data.get(position).get("product_image")) .into(viewholder.imgviewicon, new callback() { @override public void onsuccess() { viewholder.imgviewicon.setvisibility(view.visible); if (picasso.loadedfrom.network != null) yoyo.with(techniques.zoomin).duration(1200) .playon(viewholder.imgviewicon); viewholder.placeholder.setvisibility(view.gone); } @override public void onerror() { } });
please have batter option tell me. thanks.
use picasso's setindicatorenabled(true)
detect image loaded from.
picasso picasso = picasso.with(context); picasso.setindicatorsenabled(true); //... picasso.load("http://example.com/image.jpg").into(myimageview);
a colored ribbon appear in top left corner.
- red: network
- yellow: disk
- green: memory
source: picasso - debug indicators
Comments
Post a Comment