AndroidImageSlider
AndroidImageSlider copied to clipboard
needs to reload SliderView's image
My app downloads images from internet and saves them into SD card. However, images need to be shown when they are not downloaded.
I set the DefaultSliderView as below:
SliderLayout imgSlider = (SliderLayout) findViewById(R.id.image_slider);
for (String imgPath : sdPaths) {
File imgFile = new File(imgPath);
Bundle bundle = new Bundle();
bundle.putString("extra", imgPath);
DefaultSliderView view = new DefaultSliderView(this);
view.setScaleType(BaseSliderView.ScaleType.Fit)
.setOnSliderClickListener(this)
.bundle(bundle);
view.image(imgFile);
view.empty(R.drawable.refresh);
imgSlider.addSlider(view);
}
Here goes the problem:
When current view's image is downloaded, I cannot update the view immediately. I have to removeAllSliders and add them back so it can be shown. Or user swipes to next image then swipe back.
Is there any way to reload the image in DefaultSliderView?
Hello,
I used this method before calling the service again.
imageSlider.removeAllSliders();
That's the way you can try.