android - Horizontal recyclerView with volley NetworkImageView image is not displaying -
i use recycleradapter load lot of images in horizontal view using networkimageview(volley). changing position of recycler view periodically. time while scrolling image not displaying , showing white space instead of original image.
adapter onbindviewholder code:
mimageloader.get(newsdto.getimage(), imageloader.getimagelistener(holder.networkimageview, r.drawable.loading, android.r.drawable .ic_dialog_alert)); holder.networkimageview.setimageurl(newsdto.getimage(), mimageloader);
how periodically changing position:
new timer().scheduleatfixedrate(new timertask() { @override public void run() { if (getactivity() != null && recyclerview != null) { getactivity().runonuithread(new runnable() { @override public void run() { int lastvisibleitemposition = layoutmanager.findlastvisibleitemposition(); if (adapter.getitemcount() == (lastvisibleitemposition + 1)) { recyclerview.getlayoutmanager().scrolltoposition(0); } else { adapter.notifydatasetchanged(); recyclerview.getlayoutmanager().scrolltoposition(layoutmanager.findlastvisibleitemposition() + 1); } } }); } } }, 0, 30000);
am missing something?
thanks in advance!
use picasso loading images in imageview,
imageview imageview_obj; picasso.with(activity).load(newsdto.getimage()).nofade().into(imageview_obj);
Comments
Post a Comment