InfiniteCycleViewPager icon indicating copy to clipboard operation
InfiniteCycleViewPager copied to clipboard

Disappearing fragments in HorizontalInfiniteCycleViewPager

Open ahmadeqbal opened this issue 8 years ago • 11 comments

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.

ahmadeqbal avatar Sep 27 '16 08:09 ahmadeqbal

Hello. Thanks for issue. Did you saw this problem in sample app?

GIGAMOLE avatar Sep 27 '16 08:09 GIGAMOLE

Hi haven't tried sample app i'm using my own

ahmadeqbal avatar Sep 27 '16 08:09 ahmadeqbal

Try it pls.

GIGAMOLE avatar Sep 27 '16 08:09 GIGAMOLE

sample app is working fine. thank you for your awesome library

ahmadeqbal avatar Sep 27 '16 11:09 ahmadeqbal

So. Try to set all settings like in sample app. Thanks.

GIGAMOLE avatar Sep 27 '16 11:09 GIGAMOLE

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!

khalodark avatar Nov 05 '16 21:11 khalodark

any answer yet ?

khalodark avatar Nov 12 '16 13:11 khalodark

any news?

mspapant avatar Feb 18 '17 11:02 mspapant

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

vietnx92 avatar Jul 13 '17 10:07 vietnx92

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

Fjnova avatar Mar 07 '19 11:03 Fjnova

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)
        }

jary163 avatar Jul 10 '20 04:07 jary163