All Projects → iwgang → Familiarrecyclerview

iwgang / Familiarrecyclerview

Licence: mit
一个如你熟悉ListView、GridView一样熟悉的RecyclerView

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Familiarrecyclerview

Androidfastscroll
Fast scroll for Android RecyclerView and more
Stars: ✭ 316 (-15.05%)
Mutual labels:  recyclerview
Giraffeplayer2
out of the box android video player(support lazy load, ListView/RecyclerView and hight performance)
Stars: ✭ 344 (-7.53%)
Mutual labels:  recyclerview
Corbind
Kotlin Coroutines binding APIs for Android UI widgets from the platform and support libraries
Stars: ✭ 357 (-4.03%)
Mutual labels:  recyclerview
Android Gif Example
Gif RecyclerView in MVP using Dagger 2 + Retrofit 2 + Moshi + RxJava 2 + Glide 4 with JUnit and Espresso tests written in Kotlin + Kotlin DSL!
Stars: ✭ 334 (-10.22%)
Mutual labels:  recyclerview
Timeline View
Android Timeline View is used to display views like Tracking of shipment/order, steppers etc.
Stars: ✭ 3,553 (+855.11%)
Mutual labels:  recyclerview
Recyclerstickyheaderview
Sticky header view or suspending view for RecyclerView.
Stars: ✭ 347 (-6.72%)
Mutual labels:  recyclerview
Recycleritemdecoration
ItemDecoration for RecyclerView using LinearLayoutManager for Android
Stars: ✭ 320 (-13.98%)
Mutual labels:  recyclerview
Android Extensions
An Android library with modules to quickly bootstrap an Android application.
Stars: ✭ 356 (-4.3%)
Mutual labels:  recyclerview
Stacklayoutmanager
customized layoutmanager,let item pile up like stackview/类似最美有物卡片堆叠效果
Stars: ✭ 343 (-7.8%)
Mutual labels:  recyclerview
Androidproject
Android 技术中台,但愿人长久,搬砖不再有
Stars: ✭ 4,398 (+1082.26%)
Mutual labels:  recyclerview
Flexibleadapter
Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
Stars: ✭ 3,482 (+836.02%)
Mutual labels:  recyclerview
Recycler View Divider
A library which configures a divider for a RecyclerView.
Stars: ✭ 338 (-9.14%)
Mutual labels:  recyclerview
Brv
Android上最强大的RecyclerView库
Stars: ✭ 345 (-7.26%)
Mutual labels:  recyclerview
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+844.09%)
Mutual labels:  recyclerview
Multichoicerecyclerview
Multi choice selection applied on recycler view make life easier
Stars: ✭ 361 (-2.96%)
Mutual labels:  recyclerview
Swipedelmenulayout
The most simple SwipeMenu in the history, 0 coupling, support any ViewGroup. Step integration swipe (delete) menu, high imitation QQ, iOS. ~史上最简单侧滑菜单,0耦合,支持任意ViewGroup。一步集成侧滑(删除)菜单,高仿QQ、IOS。~
Stars: ✭ 3,376 (+807.53%)
Mutual labels:  recyclerview
Recyclerlistview
High performance listview for React Native and web!
Stars: ✭ 4,033 (+984.14%)
Mutual labels:  recyclerview
Dragselectrecyclerview
TouchListener that can be attached to any RecyclerView and handles multi selection for you
Stars: ✭ 371 (-0.27%)
Mutual labels:  recyclerview
Imageviewer
🔮图片浏览器,支持图片手势缩放、拖拽等操作,`自定义View`的模式显示,自定义图片加载方式,更加灵活,易于扩展,同时也适用于RecyclerView、ListView的横向和纵向列表模式,最低支持版本为Android 3.0及以上...
Stars: ✭ 363 (-2.42%)
Mutual labels:  recyclerview
Recyclerviewitemdecorations
ItemDecoration for Android Recyclerview
Stars: ✭ 351 (-5.65%)
Mutual labels:  recyclerview

Android Arsenal @iwgang

FamiliarRecyclerView

这是一个如你熟悉ListView、GridView一样熟悉的RecyclerView类库,你可以用以前使用ListView / GridView的习惯来使用RecyclerView,这些可让你将项目原有的ListView / GridView / 瀑布流 迁移到RecyclerView时减少许多工作量.

效果图

gradle

// androidx
implementation 'com.github.iwgang:familiarrecyclerview:1.3.5'

// android.support
implementation 'com.github.iwgang:familiarrecyclerview:1.3.4'

这些是不是很熟悉?

// 添加/删除 头部View (支持多个)
mRecyclerView.addHeaderView() 和 .removeHeaderView()

// 添加/删除 底部View (支持多个)
mRecyclerView.addFooterView() 和 .removeFooterView()

// 设置分割线(也可以在布局文件中直接指定分割线Divider及分割线大小,当然你也可以使用自己的分割线实现)
mRecyclerView.setDivider() 如果是网格或瀑布流视图,你甚至可以设置横竖不同的分割线Divider及分割线大小

// 设置数据空View(设置isRetainShowHeadOrFoot为true时,可以让显示EmptyView时不会清除掉添加的HeadView和FooterView)
mRecyclerView.setEmptyView()

// Item单击事件
mRecyclerView.setOnItemClickListener(new FamiliarRecyclerView.OnItemClickListener() {
    @Override
    public void onItemClick(FamiliarRecyclerView familiarRecyclerView, View view, int position) {
        // ...
    }
});

// Item长按事件
mRecyclerView.setOnItemLongClickListener(new FamiliarRecyclerView.OnItemLongClickListener() {
    @Override
    public boolean onItemLongClick(FamiliarRecyclerView familiarRecyclerView, View view, int position) {
        return true;
    }
});

// 设置滚动到顶部或底部时的事件回调
mRecyclerView.setOnScrollListener(new FamiliarRecyclerViewOnScrollListener(mRecyclerView.getLayoutManager()) {
    @Override
    public void onScrolledToTop() {
        // top
    }

    @Override
    public void onScrolledToBottom() {
        // bottom
    }
});

另外新增了 简易Adapter 另提供一个用于DataBinding中的通用Adapter

mAdapter = new FamiliarEasyAdapter<UserInfo>(this, R.layout.item_view, data) {
    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        TextView tvName = holder.findView(R.id.tv_name);
        tvName.setText(mAdapter.getData(position).getName());
    }
};

等...
当然,RecyclerView原有的那些全部都能正常使用的

布局

// LinearLayout (ListView)
<cn.iwgang.familiarrecyclerview.FamiliarRecyclerView
    android:id="@+id/mRecyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbars="vertical"
    app:frv_divider="#696969"
    app:frv_dividerHeight="1dp"
    app:frv_emptyView="@id/tv_empty"
    app:frv_layoutManager="linear"
    app:frv_layoutManagerOrientation="vertical" />
    
// GridLayout (GridView)
<cn.iwgang.familiarrecyclerview.FamiliarRecyclerView
    android:id="@+id/mRecyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbars="vertical"
    app:frv_dividerHorizontal="#FFEE00"
    app:frv_dividerVertical="#FFCCDD"
    app:frv_dividerHorizontalHeight="10dp"
    app:frv_dividerVerticalHeight="30dp"
    app:frv_itemViewBothSidesMargin="20dp"
    app:frv_layoutManager="grid"
    app:frv_layoutManagerOrientation="vertical"
    app:frv_spanCount="3" />
    
// StaggeredGridLayout (瀑布流)
<cn.iwgang.familiarrecyclerview.FamiliarRecyclerView
      android:id="@+id/mRecyclerView"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:scrollbars="vertical"
      app:frv_divider="#EFADEF"
      app:frv_dividerHorizontalHeight="10dp"
      app:frv_dividerVerticalHeight="10dp"
      app:frv_itemViewBothSidesMargin="20dp"
      app:frv_layoutManager="staggeredGrid"
      app:frv_layoutManagerOrientation="vertical"
      app:frv_spanCount="2" />

下拉刷新 + 加载更多

在1.3.0版本开始,新增加了FamiliarRefreshRecyclerView来实现下拉刷新及加载更多 建议参考示例代码

// 布局 (FamiliarRecyclerView的属性全可以使用,List、Gird、staggeredGrid均可设置)
<cn.iwgang.familiarrecyclerview.FamiliarRefreshRecyclerView
    android:id="@+id/cv_refreshListRecyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbars="vertical"
    app:frv_divider="#333333"
    app:frv_dividerHeight="0.5dp"
    app:frv_emptyView="@id/tv_empty"
    app:frv_isEmptyViewKeepShowHeadOrFooter="true"
    app:frv_layoutManager="linear"
    app:frv_layoutManagerOrientation="vertical" />

// 下拉刷新回调
mCvRefreshListRecyclerView.setOnPullRefreshListener(...)

// 加载更多回调
mCvRefreshListRecyclerView.setOnLoadMoreListener(...)

// 设置加载更多的View
mCvRefreshListRecyclerView.setLoadMoreView(...)

// 设置启动/停用下拉刷新
mCvRefreshListRecyclerView.setLoadMoreEnabled(true / false);

// 设置启动/停用加载更多
mCvRefreshListRecyclerView.setPullRefreshEnabled(true / false);

自定义配置

参数 类型 默认值 说明
frv_divider reference / color 全局分割线divider
frv_dividerVertical reference / color 垂直分割线divider
frv_dividerHorizontal reference / color 水平分割线divider
frv_dividerHeight dimension 1px 全局分割线size
frv_dividerVerticalHeight dimension 1px 垂直分割线size
frv_dividerHorizontalHeight dimension 1px 水平分割线size
frv_dividerHorizontalLeftMargin dimension 水平分割线左边距
frv_dividerHorizontalRightMargin dimension 水平分割线右边距
frv_dividerVerticalTopMargin dimension 垂直分割线上边距
frv_dividerVerticalBottomMargin dimension 垂直分割线下边距
frv_isNotShowGridEndDivider boolean false 是否不显示Grid最后item的分割线
frv_itemViewBothSidesMargin dimension itemView两边的边距(不会设置headerView和footerView的两边)
frv_emptyView reference emptyView id
frv_isEmptyViewKeepShowHeadOrFooter boolean false 显示EmptyView时,是否保留显示已设置的HeadView和FooterView
frv_layoutManager linear / grid / staggeredGrid linear 布局类型
frv_layoutManagerOrientation horizontal / vertical vertical 布局方向
frv_spanCount integer 2 格子数量,frv_layoutManager=grid / staggeredGrid时有效
frv_headerDividersEnabled boolean false 是否启用headView中的分割线
frv_footerDividersEnabled boolean false 是否启用footerView中的分割线
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].