From 6b88dc76ea1a581151535ab45881cfc054be9145 Mon Sep 17 00:00:00 2001 From: Administrator <327785185> Date: Sun, 25 Aug 2019 23:06:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8A=A0=E8=BD=BD=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=AF=B9=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/catchpig/mvp/base/adapter/RecyclerAdapter.kt | 2 +- .../com/catchpig/mvp/widget/refresh/IPageControl.kt | 2 +- .../mvp/widget/refresh/RefreshLayoutWrapper.kt | 11 +---------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/mvp/src/main/java/com/catchpig/mvp/base/adapter/RecyclerAdapter.kt b/mvp/src/main/java/com/catchpig/mvp/base/adapter/RecyclerAdapter.kt index 7d5ca06..474c012 100644 --- a/mvp/src/main/java/com/catchpig/mvp/base/adapter/RecyclerAdapter.kt +++ b/mvp/src/main/java/com/catchpig/mvp/base/adapter/RecyclerAdapter.kt @@ -148,7 +148,6 @@ abstract class RecyclerAdapter: RecyclerView.Adapter,IAdapt override fun autoUpdateList(list: MutableList?) { pageControl?.let { - it.updateSuccess(list) when (it.getRefreshStatus()) { RefreshState.Refreshing -> { set(list) @@ -157,6 +156,7 @@ abstract class RecyclerAdapter: RecyclerView.Adapter,IAdapt add(list) } } + it.updateSuccess(list) } } diff --git a/mvp/src/main/java/com/catchpig/mvp/widget/refresh/IPageControl.kt b/mvp/src/main/java/com/catchpig/mvp/widget/refresh/IPageControl.kt index df8abce..d6d7c6c 100644 --- a/mvp/src/main/java/com/catchpig/mvp/widget/refresh/IPageControl.kt +++ b/mvp/src/main/java/com/catchpig/mvp/widget/refresh/IPageControl.kt @@ -10,7 +10,7 @@ import com.scwang.smart.refresh.layout.constant.RefreshState * 描述: 页码关联 */ interface IPageControl { - + var pageSize:Int var nextPageIndex:Int fun getRefreshStatus():RefreshState diff --git a/mvp/src/main/java/com/catchpig/mvp/widget/refresh/RefreshLayoutWrapper.kt b/mvp/src/main/java/com/catchpig/mvp/widget/refresh/RefreshLayoutWrapper.kt index 8186b6a..11462b5 100644 --- a/mvp/src/main/java/com/catchpig/mvp/widget/refresh/RefreshLayoutWrapper.kt +++ b/mvp/src/main/java/com/catchpig/mvp/widget/refresh/RefreshLayoutWrapper.kt @@ -47,20 +47,11 @@ class RefreshLayoutWrapper( /** * 一页的条目,默认16 */ - private var pageSize = 16 + override var pageSize = 16 override fun getRefreshStatus(): RefreshState { return state } - /** - * 设置单页加载数据数 - * - * @param pageSize 单页数据项 - */ - fun setPageSize(pageSize: Int) { - this.pageSize = pageSize - } - /** * 列表更新成功 *