version:2.1
fix: update:优化没有数据时的显示
This commit is contained in:
@@ -77,6 +77,15 @@ public class SecondFragment extends BaseFragment {
|
|||||||
@BindView(R.id.tv_price)
|
@BindView(R.id.tv_price)
|
||||||
TextView 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)
|
@BindView(R.id.cl_activity)
|
||||||
ConstraintLayout cl_activity;
|
ConstraintLayout cl_activity;
|
||||||
|
|
||||||
@@ -170,6 +179,7 @@ public class SecondFragment extends BaseFragment {
|
|||||||
Log.e("getDemandList", "onNext: " + listBaseResponse);
|
Log.e("getDemandList", "onNext: " + listBaseResponse);
|
||||||
if (listBaseResponse.code == 200) {
|
if (listBaseResponse.code == 200) {
|
||||||
cl4.setVisibility(View.VISIBLE);
|
cl4.setVisibility(View.VISIBLE);
|
||||||
|
iv4.setVisibility(View.GONE);
|
||||||
List<DemandBean> demandBeans = listBaseResponse.data;
|
List<DemandBean> demandBeans = listBaseResponse.data;
|
||||||
if (demandBeans != null && demandBeans.size() != 0) {
|
if (demandBeans != null && demandBeans.size() != 0) {
|
||||||
DemandBean demandBean = demandBeans.get(0);
|
DemandBean demandBean = demandBeans.get(0);
|
||||||
@@ -177,6 +187,7 @@ public class SecondFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cl4.setVisibility(View.GONE);
|
cl4.setVisibility(View.GONE);
|
||||||
|
iv4.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,6 +224,7 @@ public class SecondFragment extends BaseFragment {
|
|||||||
Log.e("getActivityList", "onNext: " + listBaseResponse);
|
Log.e("getActivityList", "onNext: " + listBaseResponse);
|
||||||
if (listBaseResponse.code == 200) {
|
if (listBaseResponse.code == 200) {
|
||||||
cl3.setVisibility(View.VISIBLE);
|
cl3.setVisibility(View.VISIBLE);
|
||||||
|
iv3.setVisibility(View.GONE);
|
||||||
List<ActivityBean> activityBeans = listBaseResponse.data;
|
List<ActivityBean> activityBeans = listBaseResponse.data;
|
||||||
if (activityBeans != null && activityBeans.size() != 0) {
|
if (activityBeans != null && activityBeans.size() != 0) {
|
||||||
ActivityBean activityBean = activityBeans.get(0);
|
ActivityBean activityBean = activityBeans.get(0);
|
||||||
@@ -220,6 +232,7 @@ public class SecondFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cl3.setVisibility(View.GONE);
|
cl3.setVisibility(View.GONE);
|
||||||
|
iv3.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,6 +292,7 @@ public class SecondFragment extends BaseFragment {
|
|||||||
Log.e("getGoods", "onNext: " + listBaseResponse);
|
Log.e("getGoods", "onNext: " + listBaseResponse);
|
||||||
if (listBaseResponse.code == 200) {
|
if (listBaseResponse.code == 200) {
|
||||||
cl1.setVisibility(View.VISIBLE);
|
cl1.setVisibility(View.VISIBLE);
|
||||||
|
iv1.setVisibility(View.GONE);
|
||||||
List<GoodsInfo> goodsInfoList = listBaseResponse.data;
|
List<GoodsInfo> goodsInfoList = listBaseResponse.data;
|
||||||
if (goodsInfoList != null && goodsInfoList.size() != 0) {
|
if (goodsInfoList != null && goodsInfoList.size() != 0) {
|
||||||
GoodsInfo goodsInfo = goodsInfoList.get(0);
|
GoodsInfo goodsInfo = goodsInfoList.get(0);
|
||||||
@@ -286,6 +300,7 @@ public class SecondFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cl1.setVisibility(View.GONE);
|
cl1.setVisibility(View.GONE);
|
||||||
|
iv1.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,6 +337,7 @@ public class SecondFragment extends BaseFragment {
|
|||||||
Log.e("getArticle", "onNext: " + listBaseResponse);
|
Log.e("getArticle", "onNext: " + listBaseResponse);
|
||||||
if (listBaseResponse.code == 200) {
|
if (listBaseResponse.code == 200) {
|
||||||
cl2.setVisibility(View.VISIBLE);
|
cl2.setVisibility(View.VISIBLE);
|
||||||
|
iv2.setVisibility(View.GONE);
|
||||||
List<ArticleInfo> articleInfos = listBaseResponse.data;
|
List<ArticleInfo> articleInfos = listBaseResponse.data;
|
||||||
if (articleInfos != null && articleInfos.size() != 0) {
|
if (articleInfos != null && articleInfos.size() != 0) {
|
||||||
ArticleInfo articleInfo = articleInfos.get(0);
|
ArticleInfo articleInfo = articleInfos.get(0);
|
||||||
@@ -329,6 +345,7 @@ public class SecondFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cl2.setVisibility(View.GONE);
|
cl2.setVisibility(View.GONE);
|
||||||
|
iv2.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,13 +40,6 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/cl1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/textView9">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv1"
|
android:id="@+id/iv1"
|
||||||
android:layout_width="80dp"
|
android:layout_width="80dp"
|
||||||
@@ -59,6 +52,13 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView9">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_img"
|
android:id="@+id/iv_img"
|
||||||
android:layout_width="152dp"
|
android:layout_width="152dp"
|
||||||
@@ -194,14 +194,6 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/cl2"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/textView13">
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv2"
|
android:id="@+id/iv2"
|
||||||
android:layout_width="80dp"
|
android:layout_width="80dp"
|
||||||
@@ -214,6 +206,13 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView13">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_aimg"
|
android:id="@+id/iv_aimg"
|
||||||
android:layout_width="224dp"
|
android:layout_width="224dp"
|
||||||
@@ -347,7 +346,7 @@
|
|||||||
android:background="@drawable/custom_background">
|
android:background="@drawable/custom_background">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv3"
|
android:id="@+id/iv4"
|
||||||
android:layout_width="80dp"
|
android:layout_width="80dp"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
|
|||||||
Reference in New Issue
Block a user