Giter Site home page Giter Site logo

kotlinrecyclerview's Introduction

Android RecyclerView

介绍:本库完成了所有RecyclerView到ListView的功能增强,以及扩展封装,包括简化的分隔线/header/footer头增加,ExpandListView/以及Tree的封装,类ListView的选择状态封装,以及更为强大的动态插入条目映射功能封装

仓库引用

compile 'com.cz.recyclerlibrary:recyclerlibrary:1.2.8'

Sample下载

主要实现功能模块

  • 下拉刷新上拉加载封装
  • Adapter功能增强
  • RecyclerView拖动封装
  • RecyclerView StickyHeader封装
  • LayoutManager实现各种类列表

下拉刷新模块

模块封装为另一个

Adapter功能增强

包装使用

  • DynamicAdapter

    维护另一套映射角标的数据适配器,取代常规的Header/FooterAdapter,使用更为强大的设计,使其不仅支持Header/Footer,还支持往中间任一位置,插入任何自定义View的功能,而不影响本身被包装的Adapter功能

  • RefreshAdapter

    一个专为固定底部刷新头的增强型Adapter,无具体其他具体,只为让PullToRefreshRecyclerView,仅通过刷新模式控制最底部的刷新控件,而无法通过Footer控制

  • SelectAdapter

    为列表增加更便捷的选中模式

    • 点击(常规点击,默认此模式)
    • 单选(单选)
    • 多选(可限定最大选中个数)
    • 块选(start->end)

继承使用

  • DragAdapter(配合DragRecyclerView使用)
  • ExpandAdapter(配合ExpandRecyclerView使用,继承自PullToRefreshRecyclerView)故默认支持添加header/footer/dynamic,以及所有功能
  • TreeAdapter(扩展使其支持支持树形结构列表)

StickyHeader 功能

为了兼容之前所有操作,Sticky继承自PullToRefreshRecyclerView,并支持所有操作,市面上添加StikcyHeader主要为两种方式.一种为自定义ViewGroup并做包装,另一种增强RecyclerView的ItemDecration,进行绘制StickyHeader功能,分析两种,有好有坏

  • 自定义ViewGroup并添加StickyHeader问题,在于因为与RecyclerView的层级问题,会遮住列表最顶上的越界渲染层,另一个则是更新数据后的同步问题

  • 绘制StickyHeader,本身直接在RecyclerView内进行绘制,但因其本身仅为StickyHeader,所以不好解决点击问题
    本方案采用第一种自定义ViewGroup方式

实现功能为

  • 任一功能布局定制
  • 自动同步数据变化
  • 无缝支持以前所有的功能

![Image](https://github.com/momodae/KotlinRecyclerView/blob/master/app/screenshot/image3.gif?raw=true)

自定义LayoutManager

主要用于做其他类列表功能,以及横纵向,天生无限排版,的原生LayoutManager支持

  • CenterLayoutManager支持居中列表排版,以及点击
    CenterLayoutManager
  • Gallery:横纵向的类Gallery的LayoutManager
    CenterLayoutManager
  • Wheel:支持Wheel功能的LayoutManager封装
    CenterLayoutManager
  • ViewPager:增加了速率滚动单页的限制,以及无限滚动,可做为图片滚播图
    CenterLayoutManager
  • Table:为LayoutManager支持了横向纵向滚动表格的功能.





本库为以前RecyclerViewLibrary改良库,首先采用Kotlin完全重写,将以前DynamicAdapter复杂的逻辑简化,使其最核心逻辑,动态条目映射代码,以及其他代码,更清晰异懂.并修正了其映射变化的bug,增加了LayoutManager模块 -2017/10/10

kotlinrecyclerview's People

Contributors

jackchen365 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

durunzhe cym4u

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.