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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -