InfiniteCycleViewPager
InfiniteCycleViewPager copied to clipboard
Disappearing fragments in HorizontalInfiniteCycleViewPager
i'm using HorizontalInfiniteCycleViewPager in my application with 5 fragments. the issue is when i'm scrolling backwards (only backwards) after 2 scrolls everything is disappeared and i should scroll 5 times again in backwards to reveal fragments again. i'v tried FragmentStatePagerAdapter and FragmentPagerAdapter for my adapter but got nothing.
Hello. Thanks for issue. Did you saw this problem in sample app?
Hi haven't tried sample app i'm using my own
Try it pls.
sample app is working fine. thank you for your awesome library
So. Try to set all settings like in sample app. Thanks.
Hi GIGAMOLE I tried your samples, but none of them solved the problem titled here. the main problem of Disappearing fragments in HorizontalInfiniteCycleViewPager does exist, my viewpager returns fragments each on its own (every fragment is different from the other) but when press backward the fragment is disappearing ! which sample you told to try, I tried them all!
any answer yet ?
any news?
just comment //page.setVisibility(View.GONE); in function: public void transformPage(final View page, final float position){//...} in inner-class public void processAttributeSet(final AttributeSet attributeSet){//...} file InfiniteCycleManager.class
I got this issue when creating page by code like this: // final VerticalInfiniteCycleViewPager infiniteCycleViewPager = new VerticalInfiniteCycleViewPager(context) final HorizontalInfiniteCycleViewPager infiniteCycleViewPager = new HorizontalInfiniteCycleViewPager (context)
I resolved by adding default settings like: infiniteCycleViewPager.setAdapter(...); infiniteCycleViewPager.setScrollDuration(500); infiniteCycleViewPager.setInterpolator(...); infiniteCycleViewPager.setMediumScaled(true); infiniteCycleViewPager.setMaxPageScale(0.8F); infiniteCycleViewPager.setMinPageScale(0.5F); infiniteCycleViewPager.setCenterPageScaleOffset(30.0F); infiniteCycleViewPager.setMinPageScaleOffset(5.0F); infiniteCycleViewPager.setOnInfiniteCyclePageTransformListener(...);
I did not see any note about setting is mandatory.
Anyway, Thanks for the awesome library
the fragment will circle use,so .you must get View with fragment。like this
override fun instantiateItem(container: ViewGroup, position: Int): Any {
val normallFragment = NormallFragment().apply { arguments = Bundle() }
val itemView = normallFragment.onCreateView(LayoutInflater.from(container.context), container, null)
container.addView(itemView)
return itemView!!
}
override fun destroyItem(container: ViewGroup, position: Int, oc: Any) {
container.removeView(oc as View)
}