AndroidImageSlider icon indicating copy to clipboard operation
AndroidImageSlider copied to clipboard

Some slides not visible and page indicator starts with wrong position

Open akshay7692 opened this issue 8 years ago • 2 comments

I have used same image from R.drawable resource in all of the four slides in my slider. I am applying different transformation each time onPageSelected() is called, to get random animations. However, sometimes slider appears blank without description. Animation and pager indicator is displayed properly in such cases.

I noticed that every time I run my app, slider shows blank slide for one particular animation. Next time I run my app, blank slide is shown for some other animation. In my case, blank slide is appearing for Foreground2Background, RotateDown, RotateUp, Stack and Tablet transformations. I am not getting any error/warning in logcat while slider is blank.

Also when animation starts, pager indicator stays at 1st position for both 0th slide and 1st slide and then it starts updating from 2nd slide. (I am using using startAutoCycle(delay,duration,autoRecover)).

Please help me regarding this issue. Thanks in advance !

akshay7692 avatar Sep 27 '16 15:09 akshay7692

It seems that using custom indicator leads to problem. At this time, i'm using this workaround.

try {
    Class<?> c = mCustomIdicator.getClass();
    Field f = c.getDeclaredField("mPreviousSelectedPosition");
    f.setAccessible(true);
    f.setInt(mCustomIdicator, -1);
    f.setAccessible(false);
} catch (Exception e) { /* ignored */ }
mSliderLayout.setCustomIndicator(mCustomIdicator);

I'd think that starting the indicator with value -1 is enough to correct the library.

darlanmoraes avatar Oct 16 '16 21:10 darlanmoraes

any reference where this need to add code and little explanation will help how it solve the issue.

zia-limemedia avatar Jul 05 '18 11:07 zia-limemedia