version:2.1
fix: update:优化没有数据时的显示
This commit is contained in:
@@ -77,6 +77,15 @@ public class SecondFragment extends BaseFragment {
|
||||
@BindView(R.id.tv_price)
|
||||
TextView tv_price;
|
||||
|
||||
@BindView(R.id.iv1)
|
||||
ImageView iv1;
|
||||
@BindView(R.id.iv2)
|
||||
ImageView iv2;
|
||||
@BindView(R.id.iv3)
|
||||
ImageView iv3;
|
||||
@BindView(R.id.iv4)
|
||||
ImageView iv4;
|
||||
|
||||
@BindView(R.id.cl_activity)
|
||||
ConstraintLayout cl_activity;
|
||||
|
||||
@@ -170,13 +179,15 @@ public class SecondFragment extends BaseFragment {
|
||||
Log.e("getDemandList", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
cl4.setVisibility(View.VISIBLE);
|
||||
iv4.setVisibility(View.GONE);
|
||||
List<DemandBean> demandBeans = listBaseResponse.data;
|
||||
if (demandBeans != null && demandBeans.size() != 0) {
|
||||
DemandBean demandBean = demandBeans.get(0);
|
||||
setDemand(demandBean);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
cl4.setVisibility(View.GONE);
|
||||
iv4.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,13 +224,15 @@ public class SecondFragment extends BaseFragment {
|
||||
Log.e("getActivityList", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
cl3.setVisibility(View.VISIBLE);
|
||||
iv3.setVisibility(View.GONE);
|
||||
List<ActivityBean> activityBeans = listBaseResponse.data;
|
||||
if (activityBeans != null && activityBeans.size() != 0) {
|
||||
ActivityBean activityBean = activityBeans.get(0);
|
||||
setActivity(activityBean);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
cl3.setVisibility(View.GONE);
|
||||
iv3.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,7 +268,7 @@ public class SecondFragment extends BaseFragment {
|
||||
});
|
||||
}
|
||||
|
||||
private void openApp(){
|
||||
private void openApp() {
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
/*知道要跳转应用的包命与目标Activity*/
|
||||
ComponentName componentName = new ComponentName("com.uiui.city", "com.uiui.city.activity.MainActivity");
|
||||
@@ -279,13 +292,15 @@ public class SecondFragment extends BaseFragment {
|
||||
Log.e("getGoods", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
cl1.setVisibility(View.VISIBLE);
|
||||
iv1.setVisibility(View.GONE);
|
||||
List<GoodsInfo> goodsInfoList = listBaseResponse.data;
|
||||
if (goodsInfoList != null && goodsInfoList.size() != 0) {
|
||||
GoodsInfo goodsInfo = goodsInfoList.get(0);
|
||||
setGoodsInfo(goodsInfo);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
cl1.setVisibility(View.GONE);
|
||||
iv1.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,13 +337,15 @@ public class SecondFragment extends BaseFragment {
|
||||
Log.e("getArticle", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
cl2.setVisibility(View.VISIBLE);
|
||||
iv2.setVisibility(View.GONE);
|
||||
List<ArticleInfo> articleInfos = listBaseResponse.data;
|
||||
if (articleInfos != null && articleInfos.size() != 0) {
|
||||
ArticleInfo articleInfo = articleInfos.get(0);
|
||||
setArticleInfo(articleInfo);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
cl2.setVisibility(View.GONE);
|
||||
iv2.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user