Closed dfbarone closed 5 years ago
This does look safe to merge; but I don't see how is it possible to peek left and right item (I don't even think it is possible using ViewPager), may I know how do one user set to peek after this has been merged?
I am able to show a preview to the left and right items by setting clipToPadding="false" and adding left/right padding. I have included a screen cap.
<com.asksira.loopingviewpager.LoopingViewPager
android:id="@+id/viewpager"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:isInfinite="true"
app:autoScroll="false"
**android:clipToPadding="false"**
**android:paddingLeft="25dp"**
**android:paddingRight="25dp"**
app:scrollInterval="3000"
app:wrap_content="true"/>
OMG... You made my day!!
It works, but you can observe that user will be able to see the sudden appear of looped page because he/she can now peek the next page lol
I will merge this PR though. Thanks!
Thank you. Also, stackoverflow.com has some good information about customizing viewpagers. This is how I learned about the clipToPadding trick.
https://stackoverflow.com/questions/13914609/viewpager-with-previous-and-next-page-boundaries https://stackoverflow.com/questions/10098040/android-viewpager-show-preview-of-page-on-left-and-right
…ewPager::onMeasure.
onMeasure seems to be broken for me when adding left and right padding to 'peek' at left and right ViewPager items. Also when items scale to a particular ratio based on width.