Devlight / InfiniteCycleViewPager

Infinite cycle ViewPager with two-way orientation and interactive effect.
Apache License 2.0
5.75k stars 827 forks source link

how reload data #58

Open ahmedneffati opened 6 years ago

ahmedneffati commented 6 years ago

hi how can I reload data to the CycleViewPager

ghost commented 5 years ago

You must have your adapter to implement data creation in carousel, so if you want to update your data just update de source of it and then update adapter:

PageAdapter myPageAdapter = new PageAdapter(context, arrayData);

LavadosCarouselAdapter carousel = (HorizontalInfiniteCycleViewPager) findViewById(R.id.carousel_id);
carousel.setAdapter(myPageAdapter);

//Update data
arrayData.add(something);

//refresh adapter
myPageAdapter.notifyDataSetChanged();