Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
beiger committed Dec 16, 2018
1 parent 771e497 commit f2a26ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ abstract class BaseRecycleViewActivity<DB : ViewDataBinding, VM : BaseViewModel,
protected abstract fun initAdapter()

open fun bindAndObserve() {
data.observe(this, Observer { data -> mAdapter.mData = data })
data.observe(this, Observer { data -> mAdapter.data = data })
networkState.observe(this, Observer { status ->
if (status == null) {
return@Observer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import androidx.recyclerview.widget.RecyclerView

abstract class BaseRecycleViewAdapter<T : IsSame, VH: BaseViewHolder<*>> : RecyclerView.Adapter<VH>() {
var data: List<T>? = ArrayList()
set(data_temp: List<T>?) {
set(data_temp) {
if (data_temp == null) {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ abstract class BaseRecycleViewFragment<DB : ViewDataBinding, VM : BaseViewModel,
}
}
})
data.observe(this, Observer { list -> 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)
Expand Down

0 comments on commit f2a26ca

Please sign in to comment.