代码拉取完成,页面将自动刷新
一个用recyclerView实现的gallery,0成本学习,1分钟快速集成
Step 1. Add the JitPack repository to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
compile 'com.github.mengpeng920223:RecyclerView-Gallery:v1.0.0'
}
下载jar放到你的lib文件夹里面
RecyclerView recyclerView = findViewById(R.id.recyclerView);
//水平方向CarouselLayoutManager.HORIZONTAL 竖直方向CarouselLayoutManager.VERTICAL
CarouselLayoutManager layoutManager = new CarouselLayoutManager(CarouselLayoutManager.HORIZONTAL);
layoutManager.setPostLayoutListener(new CarouselZoomPostLayoutListener());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setHasFixedSize(true);
recyclerView.addOnScrollListener(new CenterScrollListener());
//你自己的adapter,在adapter无需做任何改动
recyclerView.setAdapter(adapter);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。