RecyclerPager

栏目: IOS · Android · 发布时间: 7年前

内容简介:当 PagerSnapHelper 出现后,使用 RecyclerView 代替 ViewPager 越来越可行了。 RecyclerView 的动态更新是基础功能,而 ViewPager 的动态更新一直是这个控件的痛点。使用 RecyclerView + PagerSnapHelper 简单的 View 展示翻页是没有问题,不过想进一步实现 RecyclerView 动态显示 Fragment 就遇到各种组件的缺失了。所以补一些 RecyclerView 相对 ViewPager 缺少的东西,写了个:

当 PagerSnapHelper 出现后,使用 RecyclerView 代替 ViewPager 越来越可行了。 RecyclerView 的动态更新是基础功能,而 ViewPager 的动态更新一直是这个控件的痛点。

使用 RecyclerView + PagerSnapHelper 简单的 View 展示翻页是没有问题,不过想进一步实现 RecyclerView 动态显示 Fragment 就遇到各种组件的缺失了。

所以补一些 RecyclerView 相对 ViewPager 缺少的东西,写了个: RecyclerPager

项目包括一些 工具 类和控件

  • RecyclerPager

    • FragmentRecyclerAdapter:管理 Fragment 加载的 Adapter

    • SnapPageScrollListener:类似 ViewPager.OnPageChangeListener 的滚动监听器

    • PageRecyclerView:适合最外层使用,优化水平或竖直方向才触发滚动的 RecyclerView

  • SmartTabLayout2

    根据 https://github.com/ogaclejapan/SmartTabLayout 改造的 TabLayout,使用了 RecyclerPager 组件,很方便的就能支持 RecyclerView + PagerSnapHelper 处理 Tab 滚动和位移

RecyclerPager


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Hacking Growth

Hacking Growth

Sean Ellis、Morgan Brown / Crown Business / 2017-4-25 / USD 29.00

The definitive playbook by the pioneers of Growth Hacking, one of the hottest business methodologies in Silicon Valley and beyond. It seems hard to believe today, but there was a time when Airbnb w......一起来看看 《Hacking Growth》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

在线进制转换器
在线进制转换器

各进制数互转换器

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具