Convert Figma logo to code with AI

jdsjlzx logoLRecyclerView

RecyclerView下拉刷新,自动加载更多;仿IOS侧滑Item删除菜单(盼望大家扩展更多功能)

2,473
599
2,473
102

Top Related Projects

BRVAH:Powerful and flexible RecyclerAdapter

An Android Animation library which easily add itemanimator to RecyclerView items.

The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...

Flexible multiple types for Android RecyclerView.

8,512

Epoxy is an Android library for building complex screens in a RecyclerView

GroupedRecyclerViewAdapter可以很方便的实现RecyclerView的分组显示,并且每个组都可以包含组头、组尾和子项;可以方便实现多种Type类型的列表,可以实现如QQ联系人的列表一样的列表展开收起功能,还可以实现头部悬浮吸顶功能等。

Quick Overview

LRecyclerView is an Android library that extends the functionality of RecyclerView. It provides features like pull-to-refresh, load more, and empty view support, making it easier for developers to implement common list-based UI patterns in Android applications.

Pros

  • Easy integration with existing RecyclerView implementations
  • Built-in support for pull-to-refresh and load more functionality
  • Customizable empty view for when the list is empty
  • Smooth animations for item additions and removals

Cons

  • Limited documentation, especially for advanced use cases
  • May require additional setup compared to standard RecyclerView
  • Some reported issues with compatibility in certain Android versions
  • Not actively maintained (last update was in 2018)

Code Examples

  1. Basic setup of LRecyclerView:
LRecyclerView mRecyclerView = findViewById(R.id.list);
LRecyclerViewAdapter mLRecyclerViewAdapter = new LRecyclerViewAdapter(myAdapter);
mRecyclerView.setAdapter(mLRecyclerViewAdapter);
  1. Adding a header view:
View header = LayoutInflater.from(this).inflate(R.layout.header_layout, null);
mLRecyclerViewAdapter.addHeaderView(header);
  1. Implementing pull-to-refresh:
mRecyclerView.setOnRefreshListener(new OnRefreshListener() {
    @Override
    public void onRefresh() {
        // Perform refresh operation
        mRecyclerView.refreshComplete(pageSize);
    }
});
  1. Implementing load more:
mRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() {
    @Override
    public void onLoadMore() {
        // Load more data
        mRecyclerView.setNoMore(true); // Call when no more data to load
    }
});

Getting Started

To use LRecyclerView in your Android project:

  1. Add the dependency to your app's build.gradle file:
dependencies {
    implementation 'com.github.jdsjlzx:LRecyclerView:1.5.4.3'
}
  1. Add LRecyclerView to your layout XML:
<com.github.jdsjlzx.recyclerview.LRecyclerView
    android:id="@+id/list"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
  1. Initialize LRecyclerView in your Activity or Fragment:
LRecyclerView mRecyclerView = findViewById(R.id.list);
LRecyclerViewAdapter mLRecyclerViewAdapter = new LRecyclerViewAdapter(myAdapter);
mRecyclerView.setAdapter(mLRecyclerViewAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));

Now you can start using LRecyclerView with its additional features in your Android application.

Competitor Comparisons

BRVAH:Powerful and flexible RecyclerAdapter

Pros of BaseRecyclerViewAdapterHelper

  • More comprehensive feature set, including animations, drag & drop, and swipe functionality
  • Larger community and more frequent updates
  • Extensive documentation and examples

Cons of BaseRecyclerViewAdapterHelper

  • Steeper learning curve due to more complex API
  • Potentially higher memory footprint for simple use cases
  • May introduce unnecessary overhead for basic RecyclerView implementations

Code Comparison

LRecyclerView:

LRecyclerViewAdapter lAdapter = new LRecyclerViewAdapter(adapter);
mRecyclerView.setAdapter(lAdapter);

BaseRecyclerViewAdapterHelper:

public class MyAdapter extends BaseQuickAdapter<MyItem, BaseViewHolder> {
    public MyAdapter(List<MyItem> data) {
        super(R.layout.item_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MyItem item) {
        helper.setText(R.id.title, item.getTitle());
    }
}

Summary

BaseRecyclerViewAdapterHelper offers a more feature-rich experience with better community support, while LRecyclerView provides a simpler implementation for basic RecyclerView needs. The choice between the two depends on the project's complexity and specific requirements.

An Android Animation library which easily add itemanimator to RecyclerView items.

Pros of recyclerview-animators

  • Offers a wide variety of pre-built animations for RecyclerView items
  • Provides easy-to-use APIs for implementing custom animations
  • Supports both Java and Kotlin

Cons of recyclerview-animators

  • Focuses solely on animations, lacking additional RecyclerView features
  • May require more setup for basic RecyclerView functionality
  • Limited built-in support for common RecyclerView patterns (e.g., pull-to-refresh)

Code Comparison

recyclerview-animators:

val animator = SlideInLeftAnimator()
recyclerView.itemAnimator = animator

LRecyclerView:

LRecyclerView recyclerView = findViewById(R.id.list);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
recyclerView.setArrowImageView(R.drawable.ic_pulltorefresh_arrow);

Summary

recyclerview-animators excels in providing a wide range of animations for RecyclerView items, offering both pre-built options and customization capabilities. It supports Java and Kotlin, making it versatile for different Android development preferences.

On the other hand, LRecyclerView offers a more comprehensive solution for RecyclerView implementation, including features like pull-to-refresh and load more functionality out of the box. It provides a simpler setup for common RecyclerView patterns but may have fewer animation options compared to recyclerview-animators.

The choice between these libraries depends on the specific needs of your project. If advanced animations are a priority, recyclerview-animators might be the better choice. For a more all-in-one solution with built-in RecyclerView patterns, LRecyclerView could be more suitable.

The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...

Pros of FastAdapter

  • More comprehensive and feature-rich library with support for various item types and layouts
  • Active development and maintenance with frequent updates and improvements
  • Extensive documentation and sample code available

Cons of FastAdapter

  • Steeper learning curve due to its more complex architecture
  • May be overkill for simple list implementations
  • Larger library size compared to LRecyclerView

Code Comparison

FastAdapter:

val fastAdapter = FastAdapter.with(itemAdapter)
recyclerView.adapter = fastAdapter

itemAdapter.add(MyItem("Item 1"))
itemAdapter.add(MyItem("Item 2"))

LRecyclerView:

val adapter = ListBaseAdapter<String>(context)
lRecyclerView.adapter = adapter

adapter.addAll(listOf("Item 1", "Item 2"))
lRecyclerView.setLoadMoreEnabled(true)

FastAdapter offers a more flexible approach to adding items and managing different view types, while LRecyclerView provides a simpler API for basic list operations and built-in load more functionality.

Flexible multiple types for Android RecyclerView.

Pros of MultiType

  • More flexible and extensible architecture for handling multiple view types
  • Simpler API with less boilerplate code
  • Better support for composition and delegation patterns

Cons of MultiType

  • Less built-in functionality for common RecyclerView features (e.g., pull-to-refresh, load more)
  • Steeper learning curve for developers used to traditional RecyclerView adapters
  • May require more custom code for complex layouts and interactions

Code Comparison

MultiType:

class ImageViewBinder : ItemViewBinder<Image, ImageViewBinder.Holder>() {
    override fun onCreateViewHolder(inflater: LayoutInflater, parent: ViewGroup): Holder {
        return Holder(inflater.inflate(R.layout.item_image, parent, false))
    }
    override fun onBindViewHolder(holder: Holder, item: Image) {
        holder.imageView.setImageURI(item.uri)
    }
    class Holder(itemView: View) : RecyclerView.ViewHolder(itemView) {
        val imageView: ImageView = itemView.findViewById(R.id.image)
    }
}

LRecyclerView:

public class ImageAdapter extends LRecyclerViewAdapter<Image> {
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_image, parent, false);
        return new ImageViewHolder(view);
    }
    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        ImageViewHolder imageViewHolder = (ImageViewHolder) holder;
        imageViewHolder.imageView.setImageURI(getItem(position).getUri());
    }
}
8,512

Epoxy is an Android library for building complex screens in a RecyclerView

Pros of Epoxy

  • More powerful and flexible for complex RecyclerView layouts
  • Built-in support for data binding and view holders
  • Better performance for large lists with many view types

Cons of Epoxy

  • Steeper learning curve and more complex setup
  • Requires more boilerplate code for simple use cases
  • May be overkill for basic list implementations

Code Comparison

LRecyclerView:

LRecyclerView recyclerView = findViewById(R.id.list);
LRecyclerViewAdapter adapter = new LRecyclerViewAdapter(myAdapter);
recyclerView.setAdapter(adapter);

Epoxy:

EpoxyRecyclerView recyclerView = findViewById(R.id.list);
recyclerView.setController(new MyEpoxyController());

Key Differences

  • LRecyclerView focuses on simplifying common RecyclerView tasks, while Epoxy provides a more comprehensive solution for complex layouts
  • Epoxy offers better support for heterogeneous view types and dynamic content
  • LRecyclerView has a simpler API for basic use cases, making it easier to get started
  • Epoxy provides more advanced features like automatic diffing and view state saving

Use Case Recommendations

  • Choose LRecyclerView for simpler list implementations with basic functionality
  • Opt for Epoxy when dealing with complex, dynamic layouts or large-scale apps with diverse view types

GroupedRecyclerViewAdapter可以很方便的实现RecyclerView的分组显示,并且每个组都可以包含组头、组尾和子项;可以方便实现多种Type类型的列表,可以实现如QQ联系人的列表一样的列表展开收起功能,还可以实现头部悬浮吸顶功能等。

Pros of GroupedRecyclerViewAdapter

  • Specialized for grouped data structures, making it easier to create sectioned lists
  • Supports multiple view types for headers, footers, and child items
  • Provides built-in expand/collapse functionality for groups

Cons of GroupedRecyclerViewAdapter

  • Less focus on general-purpose RecyclerView enhancements
  • May have a steeper learning curve for developers not familiar with grouped data structures
  • Limited built-in support for common RecyclerView features like pull-to-refresh or load more

Code Comparison

GroupedRecyclerViewAdapter:

GroupedRecyclerViewAdapter adapter = new GroupedRecyclerViewAdapter(this, list) {
    @Override
    public int getGroupCount() {
        return list.size();
    }
    // ... other overridden methods
};

LRecyclerView:

LRecyclerViewAdapter lAdapter = new LRecyclerViewAdapter(innerAdapter);
mRecyclerView.setAdapter(lAdapter);
mRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
mRecyclerView.setOnRefreshListener(onRefreshListener);

GroupedRecyclerViewAdapter is more focused on creating grouped/sectioned lists, while LRecyclerView provides a wrapper for existing adapters with additional features like pull-to-refresh and load more functionality. The choice between the two depends on the specific requirements of your project and the structure of your data.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

LRecyclerView

LRecyclerView是支持addHeaderView、 addFooterView、下拉刷新、分页加载数据的RecyclerView。

它对 RecyclerView 控件进行了拓展,给RecyclerView增加HeaderView、FooterView,并且不需要对你的Adapter做任何修改。

推荐

RxJava经典视频教程已经上线,戳我就可以看啦......

效果图

实战项目

为了方便大家更好的在项目中使用LRecyclerView,这里提供一个项目demo,有需要可以参考下!

github地址: https://github.com/jdsjlzx/Community

Gradle

Step 1. 在你的根build.gradle文件中增加JitPack仓库依赖。

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

Step 2. 在你的module的build.gradle文件中增加LRecyclerView依赖。

implementation 'com.github.jdsjlzx:LRecyclerView:1.5.4.3'

LRecyclerView requires at minimum Java 7 or Android 4.0.

JavaDoc

https://jitpack.io/com/github/jdsjlzx/LRecyclerView/1.5.4.3/javadoc/

##项目简述

  1. 下拉刷新、滑动到底部自动加载下页数据;
  2. 可以方便添加Header和Footer;
  3. 头部下拉样式可以自定义;
  4. 具备item点击和长按事件;
  5. 网络错误加载失败点击Footer重新请求数据;
  6. 可以动态为FooterView赋予不同状态(加载中、加载失败、滑到最底等);
  7. 可以根据不同的viewtype自定义item视图;
  8. 具备类似IOS侧滑删除菜单功能;
  9. 完善的局部刷新效果;

注意:

  1. EndlessLinearLayoutActivity.java类里面有标准完整的使用方法,请尽量在这个界面看效果;
  2. 本着解耦的原则,能在demo中实现的就尽量不在libray中实现。
  3. libray中的sdk版本都是最新版本,如果你不想处理申请权限的问题,可以在你本地的app的build.gradle中如下设置:
compileSdkVersion 25
buildToolsVersion '25.0.2'
    
defaultConfig {
        applicationId "com.github.jdsjlzx"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 4
        versionName "0.5.3"
}

targetSdkVersion设置为22即可。

Demo下载

点我下载

功能介绍

填充数据

mDataAdapter = new DataAdapter(this);
mDataAdapter.setData(dataList);

mLRecyclerViewAdapter = new LRecyclerViewAdapter(mDataAdapter);
mRecyclerView.setAdapter(mLRecyclerViewAdapter);
  1. DataAdapter是用户自己真正的adapter,用户自己定义;
  2. LRecyclerViewAdapter提供了一些实用的功能,使用者不用关心它的实现,只需构造的时候把自己的mDataAdapter以参数形式传进去即可。

添加HeaderView、FooterView

//add a HeaderView
mLRecyclerViewAdapter.addHeaderView(new SampleHeader(this));

//add a FooterView
mLRecyclerViewAdapter.addFooterView(new SampleFooter(this));

添加HeaderView还可以使用下面两种方式:

View header = LayoutInflater.from(this).inflate(R.layout.sample_header,(ViewGroup)findViewById(android.R.id.content), false);
mLRecyclerViewAdapter.addHeaderView(header);


CommonHeader headerView = new CommonHeader(getActivity(), R.layout.layout_home_header);
mLRecyclerViewAdapter.addHeaderView(headerView);

上面的方式同样适用于FooterView。

移除HeaderView、FooterView

//remove a HeaderView
mLRecyclerViewAdapter.removeHeaderView();

//remove a FooterView
mLRecyclerViewAdapter.removeFooterView();

注意:

1.如果有两个以上的HeaderView,连续调用mLRecyclerViewAdapter.removeHeaderView()即可。

LScrollListener-滑动监听事件接口

LScrollListener实现了onScrollUp()、onScrollDown()、onScrolled、onScrollStateChanged四个事件,如下所示:

void onScrollUp();//scroll down to up

void onScrollDown();//scroll from up to down

void onScrolled(int distanceX, int distanceY);// moving state,you can get the move distance

void onScrollStateChanged(int state);

  • onScrollUp()——RecyclerView向上滑动的监听事件;
  • onScrollDown()——RecyclerView向下滑动的监听事件;
  • onScrolled()——RecyclerView正在滚动的监听事件;
  • onScrollStateChanged(int state)——RecyclerView正在滚动的监听事件;

使用:

mRecyclerView.setLScrollListener(new LRecyclerView.LScrollListener() {
            @Override
            public void onScrollUp() {
            }

            @Override
            public void onScrollDown() {
            }

            @Override
            public void onScrolled(int distanceX, int distanceY) {
            }
            @Override
            public void onScrollStateChanged(int state) {

            }

        });
 

下拉刷新

mRecyclerView.setOnRefreshListener(new OnRefreshListener() {
            @Override
            public void onRefresh() {
                
            }
        });

加载更多

mRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() {
            @Override
            public void onLoadMore() {
                
            }
        });

设置下拉刷新样式

mRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader); //设置下拉刷新Progress的样式
mRecyclerView.setArrowImageView(R.drawable.iconfont_downgrey);  //设置下拉刷新箭头

AVLoadingIndicatorView库有多少效果,LRecyclerView就支持多少下拉刷新效果,当然你也可以自定义下拉刷新效果。

效果图:

这里写图片描述

自定义下拉刷新View

  1. 自定义view实现IRefreshHeader接口;
  2. 调用LRecyclerView提供的setRefreshHeader(IRefreshHeader refreshHeader)即可。
/**
 * 设置自定义的RefreshHeader
 */
public void setRefreshHeader(IRefreshHeader refreshHeader) {
    this.mRefreshHeader = refreshHeader;
}

设置下拉刷新Header和Footer文字内容和颜色

//设置头部加载颜色
mRecyclerView.setHeaderViewColor(R.color.colorAccent, R.color.dark ,android.R.color.white);
//设置底部加载颜色
mRecyclerView.setFooterViewColor(R.color.colorAccent, R.color.dark ,android.R.color.white);
//设置底部加载文字提示
mRecyclerView.setFooterViewHint("拼命加载中","已经全部为你呈现了","网络不给力啊,点击再试一次吧");

记得设置ProgressStyle:

mRecyclerView.setRefreshProgressStyle(ProgressStyle.LineSpinFadeLoader);
mRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallSpinFadeLoader);

开启和禁止下拉刷新功能

mRecyclerView.setPullRefreshEnabled(true);

or

mRecyclerView.setPullRefreshEnabled(false);

默认是开启。

强制刷新

根据大家的反馈,增加了一个强制刷新的方法,使用如下:

mRecyclerView.forceToRefresh();

无论是下拉刷新还是强制刷新,刷新完成后调用下面代码:

mRecyclerView.refreshComplete(pageSize);
mLRecyclerViewAdapter.notifyDataSetChanged();

下拉刷新清空数据

有的时候,需要下拉的时候清空数据并更新UI,可以这么做:

@Override
public void onRefresh() {
    mDataAdapter.clear();
    mLRecyclerViewAdapter.notifyDataSetChanged();//必须调用此方法
    mCurrentCounter = 0;
    requestData();
}

如果不需要下拉的时候清空数据并更新UI,如下即可:

@Override
public void onRefresh() {
    requestData();
}

开启和禁止自动加载更多功能

mRecyclerView.setLoadMoreEnabled(true);

or

mRecyclerView.setLoadMoreEnabled(false);;

默认是开启。如果不需要自动加载更多功能(也就是不需要分页)手动设置为false即可。

加载数据完成处理

mDataAdapter.addAll(list);
mRecyclerView.refreshComplete(REQUEST_COUNT);// REQUEST_COUNT为每页加载数量

如果没有更多数据(也就是全部加载完成),判断逻辑如下:

mRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() {
            @Override
            public void onLoadMore() {

                if (mCurrentPage < totalPage) {
                    // loading data
                    requestData();
                } else {
                    mRecyclerView.setNoMore(true);
                }
            }
        });

去除底部的加载更多的view

如果你的逻辑是一次性加载所有的数据,那么可以如下设置:

mRecyclerView.setLoadMoreEnabled(false);;

mRecyclerView.setOnLoadMoreListener就不需要设置了.

加载数据网络异常处理

加载数据时如果网络异常或者断网,LRecyclerView为你提供了重新加载的机制。

效果图:

这里写图片描述

网络异常出错代码处理如下:

mRecyclerView.setOnNetWorkErrorListener(new OnNetWorkErrorListener() {
                @Override
                public void reload() {
                    requestData();
                }
            });

上面的mFooterClick就是我们点击底部的Footer时的逻辑处理事件,很显然我们还是在这里做重新请求数据操作。

点击事件和长按事件处理

先看下怎么使用:

mLRecyclerViewAdapter.setOnItemClickListener(new OnItemClickListener() {
            @Override
            public void onItemClick(View view, int position) {
                
            }

        });

mLRecyclerViewAdapter.setOnItemLongClickListener(new OnItemLongClickListener() {
            @Override
            public void onItemLongClick(View view, int position) {
                
            }
        });

原理就是实现viewHolder.itemView的点击和长按事件。由于代码过多就不贴出来了。

viewHolder源码如下:

public static abstract class ViewHolder {
        public final View itemView;
        int mPosition = NO_POSITION;
        int mOldPosition = NO_POSITION;
        long mItemId = NO_ID;
        int mItemViewType = INVALID_TYPE;
        int mPreLayoutPosition = NO_POSITION;

设置空白View(setEmptyView)

mRecyclerView.setEmptyView(view);

需要注意的是布局文件,如下所示:

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context=".MainActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay"/>

    </android.support.design.widget.AppBarLayout>

    <com.github.jdsjlzx.recyclerview.LRecyclerView
        android:id="@+id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

    <include
        android:id="@+id/empty_view"
        layout="@layout/layout_empty"
        android:visibility="gone"/>
</android.support.design.widget.CoordinatorLayout>

关于添加分割线

经过不断优化,LRecyclerView支持了ItemDecoration,使用如下所示:

LinearLayoutManager布局设置如下:

DividerDecoration divider = new DividerDecoration.Builder(this,mLRecyclerViewAdapter)
                .setHeight(R.dimen.default_divider_height)
                .setPadding(R.dimen.default_divider_padding)
                .setColorResource(R.color.split)
                .build();
mRecyclerView.addItemDecoration(divider);

GridLayoutManager布局设置如下:

int spacing = getResources().getDimensionPixelSize(R.dimen.dp_4);
mRecyclerView.addItemDecoration(SpacesItemDecoration.newInstance(spacing, spacing, manager.getSpanCount(), Color.GRAY));

//根据需要选择使用GridItemDecoration还是SpacesItemDecoration
GridItemDecoration divider = new GridItemDecoration.Builder(this)
        .setHorizontal(R.dimen.default_divider_padding)
        .setVertical(R.dimen.default_divider_padding)
        .setColorResource(R.color.split)
        .build();
//mRecyclerView.addItemDecoration(divider);

根据需要选择使用GridItemDecoration还是SpacesItemDecoration,SpacesItemDecoration(支持多类型布局)

同样的,LuRecyclerView也支持了ItemDecoration,只是命名稍微不同(类名以Lu开头,如LuGridItemDecoration、LuSpacesItemDecoration)

滑动删除

效果图:

分组

效果图:

这里写图片描述

功能还在完善中....

PullScrollView、PullWebView也有实现,为了解耦,这两个类都放在了demo中,有需要的可以自己修改使用!

代码混淆

#LRecyclerview
-dontwarn com.github.jdsjlzx.**
-keep class com.github.jdsjlzx.progressindicator.indicators.** { *; }

如果你想了解更多混淆配置,参考:http://blog.csdn.net/jdsjlzx/article/details/51861460

注意事项

1.如果添加了footerview,不要再使用setLScrollListener方法,如有需要,自定义实现即可。如下面代码不要同时使用:

mRecyclerView.setLScrollListener(LScrollListener); 
mLRecyclerViewAdapter.addFooterView(new SampleFooter(this));

2.不要SwipeRefreshLayout与LRecyclerView一起使用,会有冲突,为了更好的满足广大用户,新增了LuRecyclerView类,可以与SwipeRefreshLayout搭配使用,详细请参考SwipeRefreshLayoutActivity类的实现。

3.关于RecyclerView自动滑动的问题

这个自动滑动归根结底是焦点问题,子item有焦点,导致RecyclerView自动滑动到了子item,在根布局上加了android:descendantFocusability="blocksDescendants",根view来处理焦点,不传给子view就能解决问题。

4.关于LRecyclerView嵌套RecyclerView滑动卡顿的问题

可以参考:https://github.com/jdsjlzx/LRecyclerView/issues/165

LRecyclerView的应用

效果图:

代码详见:https://github.com/jdsjlzx/Community

Thanks

1.SwipeDelMenuViewGroup

问题反馈

QQ交流群1:183899857
QQ交流群2:250468947

打赏

觉得本框架对你有帮助,不妨打赏赞助我一下,让我有动力走的更远。

支付宝