Skip to content

Commit

Permalink
调整加载状态获取不对的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Aug 25, 2019
1 parent a4aa4fb commit 6b88dc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ abstract class RecyclerAdapter<M>: RecyclerView.Adapter<CommonViewHolder>,IAdapt

override fun autoUpdateList(list: MutableList<M>?) {
pageControl?.let {
it.updateSuccess(list)
when (it.getRefreshStatus()) {
RefreshState.Refreshing -> {
set(list)
Expand All @@ -157,6 +156,7 @@ abstract class RecyclerAdapter<M>: RecyclerView.Adapter<CommonViewHolder>,IAdapt
add(list)
}
}
it.updateSuccess(list)
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.scwang.smart.refresh.layout.constant.RefreshState
* 描述: 页码关联
*/
interface IPageControl {

var pageSize:Int
var nextPageIndex:Int

fun getRefreshStatus():RefreshState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
* 列表更新成功
*
Expand Down

0 comments on commit 6b88dc7

Please sign in to comment.