Commit 52c0a9d0b3580248119caa32392201186d7e8394
1 parent
b7d02685
Exists in
yxb_dev
and in
1 other branch
no message
Showing
2 changed files
with
14 additions
and
9 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/presenter/consult/ConsultPresenter.java
... | ... | @@ -71,7 +71,9 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
71 | 71 | GuangGaoBean guangGaoBean = new Gson().fromJson(jsonArray.get(i).getAsJsonObject(), GuangGaoBean.class); |
72 | 72 | guangGaoBeanList.add(guangGaoBean); |
73 | 73 | } |
74 | + if (guangGaoBeanList.size()>0) | |
74 | 75 | mIView.showBanners(guangGaoBeanList); |
76 | + else ToastUtils.showToast("该地区下没有信息,请换个地区"); | |
75 | 77 | } else { |
76 | 78 | ToastUtils.showToast(jsonObject.get("message").getAsString()); |
77 | 79 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
... | ... | @@ -9,6 +9,7 @@ import android.os.Bundle; |
9 | 9 | import android.support.annotation.NonNull; |
10 | 10 | import android.support.annotation.Nullable; |
11 | 11 | import android.support.annotation.RequiresApi; |
12 | +import android.support.v4.view.ViewPager; | |
12 | 13 | import android.support.v4.widget.NestedScrollView; |
13 | 14 | import android.text.TextUtils; |
14 | 15 | import android.view.View; |
... | ... | @@ -242,16 +243,18 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
242 | 243 | |
243 | 244 | @Override |
244 | 245 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { |
245 | - describeList.clear(); | |
246 | - imgesUrl.clear(); | |
247 | - imgWebUrl.clear(); | |
248 | - guanggaoList = guangGaoBeanList; | |
249 | - for (int i = 0; i < guangGaoBeanList.size(); i++) { | |
250 | - imgesUrl.add(AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc); | |
251 | - describeList.add(guangGaoBeanList.get(i).describe); | |
252 | - imgWebUrl.add(guangGaoBeanList.get(i).url); | |
246 | + if (guangGaoBeanList.size()>0){ | |
247 | + describeList.clear(); | |
248 | + imgesUrl.clear(); | |
249 | + imgWebUrl.clear(); | |
250 | + guanggaoList = guangGaoBeanList; | |
251 | + for (int i = 0; i < guangGaoBeanList.size(); i++) { | |
252 | + imgesUrl.add(AppConfig.BASE_URL_FILE + guangGaoBeanList.get(i).fileSrc); | |
253 | + describeList.add(guangGaoBeanList.get(i).describe); | |
254 | + imgWebUrl.add(guangGaoBeanList.get(i).url); | |
255 | + } | |
256 | + initBanners(); | |
253 | 257 | } |
254 | - initBanners(); | |
255 | 258 | } |
256 | 259 | |
257 | 260 | @Override | ... | ... |