AndroidImageSlider icon indicating copy to clipboard operation
AndroidImageSlider copied to clipboard

How can i know when the slideshow was changed ?

Open cloudshooterhuman opened this issue 12 years ago • 7 comments

Hi,

I m using this amazing library, actually i need to know when the slideshow was changed.

Thank you

cloudshooterhuman avatar Sep 11 '14 15:09 cloudshooterhuman

Sorry for my late...

I don't get your point, what's the meaning of the slidershow was changed?

daimajia avatar Sep 24 '14 14:09 daimajia

Np,

I mean when the diplayed image change on the slider.

And this is my temporary solution :

 private void startTimerThread() {
    handler=new Handler();

    final Runnable r = new Runnable()
    {
        public void run()
        {
            tvSlider.setText(descriprion[mSlider.getCurrentPosition()]);
            //tvSliderDetail.setText(descriprionDetail[mSlider.getCurrentPosition()]);
            handler.postDelayed(this, 1000);
        }
    };

    handler.postDelayed(r, 1000);
}

And on my createView() i call it :

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
...
startTimerThread();
..
}

cloudshooterhuman avatar Sep 24 '14 16:09 cloudshooterhuman

Not support right now... I'll add this feature when I'm available.

daimajia avatar Sep 27 '14 00:09 daimajia

@selmanon

Here is what I did (sorry, I didn't fork the project) :

Just add this method to SliderLayout.java:

public void setOnSliderPageChangeListener(OnPageChangeListener listener){ if(listener != null){ mViewPager.setOnPageChangeListener(listener); } }

Hope it helps!

ioferraz avatar Oct 17 '14 20:10 ioferraz

littile hack. hope its helps

InfiniteViewPager infiniteViewPager = view.findViewById(com.daimajia.slider.library.R.id.daimajia_slider_viewpager);

infiniteViewPager.setOnPageChangeListener(new ViewPagerEx.OnPageChangeListener() { @Override public void onPageScrolled(final int i, final float v, final int i2) {

        }

        @Override
        public void onPageSelected(final int i) {

        }

        @Override
        public void onPageScrollStateChanged(final int i) {
        }
    });

eGorets avatar Jan 20 '15 13:01 eGorets

@eGorets your solution works for detecting the page change, but unfortunately the selected dot on the PageIndicator is not longer updated.

massimobio avatar May 04 '15 05:05 massimobio

This issues has been addressed in the this pull request: https://github.com/daimajia/AndroidImageSlider/pull/100 You can now do 'addOnPageChangedListener' on the SliderLayout. See demo app for and example.

massimobio avatar May 09 '15 02:05 massimobio