siralam / LoopingViewPager

A ViewPager and PagerAdapter combination that support auto scroll, infinite loop and page indicators.
532 stars 64 forks source link

Auto-scroll doesn't start automatically #29

Closed tapandesai closed 4 years ago

tapandesai commented 4 years ago

Auto-scroll doesn't start automatically when the screen is loaded, but once I swipe to next item manually then it starts working as expected.

Here is the xml declaration

<com.asksira.loopingviewpager.LoopingViewPager android:id="@+id/vpOffers" android:layout_width="match_parent" android:layout_height="wrap_content" android:clipToPadding="false" app:autoScroll="true" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:scrollInterval="5000" app:viewpagerAspectRatio="1.78" />

siralam commented 4 years ago

If you are using it in ConstraintLayout, I think you should specify width = 0dp and give it constraintEnd_toEndOf = parent. See if this solves the problem?

tapandesai commented 4 years ago

Thanks for the quick response. I tried what you suggested but it didn't work

siralam commented 4 years ago

Hm, no idea now since I cannot reproduce this. Would you mind post your whole Activity / Fragment and the full xml which contains the LoopingViewPager?