Infinite View Pager
===============
Augment Android's ViewPager with wrap-around functionality. Original StackOverflow question: http://stackoverflow.com/questions/7546224/viewpager-as-a-circular-queue-wrapping
## Problem
With a normal ViewPager, you can only scroll from the first page to second page (and so forth), from left-to-right. Once you reach the last page, your only option is to scroll backwards, right-to-left. In other words, 'wrap-around scrolling' (going from first-to-last, and last-to-first) is not possible.
## Solution
Use the `InfiniteViewPager` in your Activity/Fragment layout:
...
<com.antonyt.infiniteviewpager.InfiniteViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
...
Wrap your existing `PagerAdapter` with the `InfinitePagerAdapter`:
...
PagerAdapter wrappedAdapter = new InfinitePagerAdapter(adapter);
viewPager.setAdapter(wrappedAdapter);
...
Wrapped scrolling should now be possible with your `ViewPager`. The pages you see are not duplicates - each page from your `PagerAdapter` is only created once and then reused. This means you do not have to worry about managing multiple instances of the same `Fragment`.
## Caveats
It is only possible to achieve wrapping when you have at least 4 pages. This is because of the way the `ViewPager` creates, destroys, and displays the pages. No fix for the general case has been found.
没有合适的资源?快使用搜索试试~ 我知道了~
左右循环滚动的ViewPager
共145个文件
xml:44个
class:29个
java:13个
需积分: 16 8 下载量 157 浏览量
2015-01-11
17:44:53
上传
评论
收藏 2.69MB ZIP 举报
温馨提示
左右循环滚动的ViewPager(使用的是android studio 构建的) , 里面包含circleindicator 和 InfiniteViewPager
资源推荐
资源详情
资源评论
收起资源包目录
左右循环滚动的ViewPager (145个子文件)
library-debug.aar 5KB
library-release.aar 4KB
INotificationSideChannel.aidl 1KB
INotificationSideChannel.aidl 1KB
resources-debug.ap_ 12KB
resources-debug-test.ap_ 706B
resources-debug-test.ap_ 703B
demo-debug.apk 290KB
demo-debug-unaligned.apk 290KB
gradlew.bat 2KB
fileSnapshots.bin 198KB
model_data.bin 142KB
taskArtifacts.bin 82KB
fileHashes.bin 25KB
outputFileStates.bin 21KB
CircleIndicator.class 6KB
InfinitePagerAdapter.class 4KB
InfiniteViewPagerActivity.class 4KB
InfinitePagerAdapter.class 4KB
ColourFragment.class 2KB
InfiniteViewPager.class 2KB
InfiniteViewPagerActivity$MyTimeTask.class 2KB
InfiniteViewPager2Activity.class 2KB
InfiniteViewPagerActivity$2.class 1KB
InfiniteViewPager2Activity$1.class 1KB
MinFragmentPagerAdapter.class 1KB
InfiniteViewPagerActivity$1.class 1KB
MinFragmentPager2Adapter.class 1KB
MinFragmentPagerAdapter.class 1KB
InfiniteViewPagerActivity$3.class 1KB
CircleIndicator$ReverseInterpolator.class 1KB
R$styleable.class 873B
InfiniteViewPager.class 861B
BuildConfig.class 768B
BuildConfig.class 744B
R.class 744B
BuildConfig.class 633B
R$attr.class 604B
R$drawable.class 469B
R$string.class 460B
R$id.class 456B
R$animator.class 445B
R$layout.class 427B
CircleIndicator$1.class 246B
classes.dex 913KB
.gitignore 103B
build.gradle 471B
build.gradle 434B
build.gradle 150B
settings.gradle 34B
gradlew 5KB
demo.iml 7KB
library.iml 7KB
InfiniteViewPager-master.iml 921B
classes.jar 621KB
classes.jar 621KB
classes-c9cf2d41dce67c279dda7cce596efd5ddb3c9b2e.jar 241KB
internal_impl-20.0.0.jar 121KB
internal_impl-20.0.0.jar 121KB
gradle-wrapper.jar 49KB
internal_impl-20.0.0-b811e863e30dc1ba6aa9d713380e17f39d7a3cf5.jar 42KB
classes.jar 6KB
classes.jar 4KB
classes.jar 4KB
classes-22bc831510a5a35dc55528aa2cc2ae778dcb7c77.jar 3KB
support-annotations-20.0.0-297cae7ac8180eeffc0ff1edf5b3f1af25c29ba6.jar 2KB
R.java 9KB
CircleIndicator.java 6KB
InfiniteViewPagerActivity.java 4KB
InfinitePagerAdapter.java 4KB
InfiniteViewPager.java 2KB
InfiniteViewPager2Activity.java 2KB
MinFragmentPagerAdapter.java 2KB
ColourFragment.java 1KB
BuildConfig.java 491B
BuildConfig.java 481B
BuildConfig.java 475B
BuildConfig.java 465B
BuildConfig.java 460B
LICENSE 1KB
cache.properties.lock 17B
README.md 1KB
MANIFEST.MF 25B
MANIFEST.MF 25B
.name 24B
icon.png 4KB
icon.png 4KB
icon.png 3KB
icon.png 2KB
icon.png 2KB
icon.png 2KB
local.properties 471B
gradle-wrapper.properties 238B
cache.properties 31B
dependency.store 5B
dependency.store 5B
dependency.store 5B
dependency.store 5B
dependency.store 5B
manifest-merger-debug-report.txt 2KB
共 145 条
- 1
- 2
资源评论
t1623183652
- 粉丝: 12
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Python实现的自动化办公项目.zip
- 基于python实现的基于PyQt5和爬虫的小说阅读系统.zip
- 机械设计整经机上纱自动化sw20非常好的设计图纸100%好用.zip
- Screenshot_20240427_031602.jpg
- 网页PDF_2024年04月26日 23-46-14_QQ浏览器网页保存_QQ浏览器转格式(6).docx
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功