From 37a0e6d80ea4daba7ec2c39110be66467972087b Mon Sep 17 00:00:00 2001 From: goweii Date: Fri, 18 Feb 2022 20:04:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=81=B6=E5=8F=91=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/home/fragment/SearchResultFragment.java | 2 +- .../wanandroid/module/main/adapter/ArticleAdapter.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/per/goweii/wanandroid/module/home/fragment/SearchResultFragment.java b/app/src/main/java/per/goweii/wanandroid/module/home/fragment/SearchResultFragment.java index a142a125..4c87bb9c 100644 --- a/app/src/main/java/per/goweii/wanandroid/module/home/fragment/SearchResultFragment.java +++ b/app/src/main/java/per/goweii/wanandroid/module/home/fragment/SearchResultFragment.java @@ -166,7 +166,7 @@ public void searchSuccess(int code, ArticleListBean data) { mAdapter.setNewData(data.getDatas()); mAdapter.setEnableLoadMore(true); if (data.getDatas() == null || data.getDatas().isEmpty()) { - MultiStateUtils.toEmpty(msv); + MultiStateUtils.toEmpty(msv, true); } else { MultiStateUtils.toContent(msv); } diff --git a/app/src/main/java/per/goweii/wanandroid/module/main/adapter/ArticleAdapter.java b/app/src/main/java/per/goweii/wanandroid/module/main/adapter/ArticleAdapter.java index ea56a593..de7b7ccb 100644 --- a/app/src/main/java/per/goweii/wanandroid/module/main/adapter/ArticleAdapter.java +++ b/app/src/main/java/per/goweii/wanandroid/module/main/adapter/ArticleAdapter.java @@ -54,7 +54,11 @@ public void setOnItemChildViewClickListener(OnItemChildViewClickListener onItemC @Override public void setNewData(@Nullable List data) { - setNewData(data, true); + if (data == null || data.isEmpty()) { + setNewData(null, false); + } else { + setNewData(data, true); + } } public void setNewData(@Nullable List data, boolean useDiff) {