Skip to content

Commit

Permalink
perf: 整理demo注释
Browse files Browse the repository at this point in the history
  • Loading branch information
limuyang2 committed Aug 1, 2023
1 parent a7040cc commit 115b369
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,17 @@ class EmptyViewUseActivity : BaseViewBindingActivity<ActivityEmptyViewUseBinding
mAdapter.setEmptyViewLayout(this, R.layout.loading_view)

viewBinding.rvList.postDelayed({
if (mError) {
if (mError) { // 模拟网络错误
// 方式二:传入View
mAdapter.emptyView = errorView

mError = false
} else {
if (mNoData) {
if (mNoData) { // 模拟接口没有数据
mAdapter.emptyView = emptyDataView
mNoData = false
} else {
// 模拟正常数据返回
mAdapter.submitList(DataServer.getSampleData(10))
}
}
Expand Down

0 comments on commit 115b369

Please sign in to comment.