# SmartSwipeRefreshLayout **Repository Path**: miantiaox/SmartSwipeRefreshLayout ## Basic Information - **Project Name**: SmartSwipeRefreshLayout - **Description**: No description available - **Primary Language**: Android - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-10 - **Last Updated**: 2021-12-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SmartSwipeRefreshLayout [![version](https://jitpack.io/v/BugRui/SmartSwipeRefreshLayout.svg)](https://jitpack.io/#BugRui/SmartSwipeRefreshLayout/v1.0.3) 基于原生自带SwipeRefreshLayout封装,添加自动预加载数据,实现无感加载。 #### Step 1. Add the JitPack repository to your build file ``` allprojects { repositories { ... maven { url 'https://jitpack.io' } } } ``` #### Step 2. Add the dependency ``` implementation 'com.github.BugRui:SmartSwipeRefreshLayout:v1.0.3' ``` 因为SmartSwipeRefreshLayout只在内部使用compileOnly,并且依赖于SwipeRefreshLayout和RecyclerView,所以需要将以下依赖项添加到自己的项目中,否则compileOnly将无法通过打包 ``` implementation 'androidx.swiperefreshlayout:swiperefreshlayout:latest.integration' implementation 'androidx.recyclerview:recyclerview:latest.integration' ``` ### 使用(use) #### 在Xml中配置 Configure in Xml ``` ``` ### 自身配置 Its configuration ``` //配置预取距离,当前最后可见Item距离最后一条的Item (默认为5) setPrefetchDistance(5) //下拉刷新监听 setOnRefreshingListener() //自动刷新 autoRefreshing() //加载刷新完成 finishRefreshing() //加载更多完成 finishLoadingMore() //加载完成全部,不会继续加载,下拉刷新会重置 finishLoadingMoreAll() //重置加载完成全部 setNoLoadingMoreAll() //智能加载监听 setOnLoadMoreListener() //下拉刷新和智能加载监听 setOnRefreshLoadMoreListener() ```