From f2a26ca94273eafe0ffaf6a1cb9204abe6ecfa51 Mon Sep 17 00:00:00 2001 From: beiger <1441512921@qq.com> Date: Sun, 16 Dec 2018 19:40:00 +0800 Subject: [PATCH] fix bug --- .../bing/mvvmbase/base/recycleview/BaseRecycleViewActivity.kt | 2 +- .../bing/mvvmbase/base/recycleview/BaseRecycleViewAdapter.kt | 2 +- .../bing/mvvmbase/base/recycleview/BaseRecycleViewFragment.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewActivity.kt b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewActivity.kt index c37bd7c..2acf1ce 100644 --- a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewActivity.kt +++ b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewActivity.kt @@ -89,7 +89,7 @@ abstract class BaseRecycleViewActivity mAdapter.mData = data }) + data.observe(this, Observer { data -> mAdapter.data = data }) networkState.observe(this, Observer { status -> if (status == null) { return@Observer diff --git a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewAdapter.kt b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewAdapter.kt index b763e91..14afed4 100644 --- a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewAdapter.kt +++ b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewAdapter.kt @@ -13,7 +13,7 @@ import androidx.recyclerview.widget.RecyclerView abstract class BaseRecycleViewAdapter> : RecyclerView.Adapter() { var data: List? = ArrayList() - set(data_temp: List?) { + set(data_temp) { if (data_temp == null) { return } diff --git a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewFragment.kt b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewFragment.kt index 9d6ae21..6ebfda1 100644 --- a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewFragment.kt +++ b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewFragment.kt @@ -129,7 +129,7 @@ abstract class BaseRecycleViewFragment mAdapter.mData = list }) + data.observe(this, Observer { list -> mAdapter.data = list }) refreshState.observe(this, Observer { status -> if (status != Status.LOADING) { mRefreshLayout.finishRefresh(status == Status.SUCCESS)