version:2.1 beta
fix: update:没有数据显示图标
This commit is contained in:
@@ -82,6 +82,15 @@ public class SecondFragment extends BaseFragment {
|
||||
|
||||
@BindView(R.id.cl_demand)
|
||||
ConstraintLayout cl_demand;
|
||||
@BindView(R.id.cl1)
|
||||
ConstraintLayout cl1;
|
||||
@BindView(R.id.cl2)
|
||||
ConstraintLayout cl2;
|
||||
@BindView(R.id.cl3)
|
||||
ConstraintLayout cl3;
|
||||
@BindView(R.id.cl4)
|
||||
ConstraintLayout cl4;
|
||||
|
||||
|
||||
private View rootView;
|
||||
private Context mContext;
|
||||
@@ -160,11 +169,14 @@ public class SecondFragment extends BaseFragment {
|
||||
public void onNext(@NonNull BaseResponse<List<DemandBean>> listBaseResponse) {
|
||||
Log.e("getDemandList", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
cl4.setVisibility(View.VISIBLE);
|
||||
List<DemandBean> demandBeans = listBaseResponse.data;
|
||||
if (demandBeans != null && demandBeans.size() != 0) {
|
||||
DemandBean demandBean = demandBeans.get(0);
|
||||
setDemand(demandBean);
|
||||
}
|
||||
}else {
|
||||
cl4.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,11 +212,14 @@ public class SecondFragment extends BaseFragment {
|
||||
public void onNext(@NonNull BaseResponse<List<ActivityBean>> listBaseResponse) {
|
||||
Log.e("getActivityList", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
cl3.setVisibility(View.VISIBLE);
|
||||
List<ActivityBean> activityBeans = listBaseResponse.data;
|
||||
if (activityBeans != null && activityBeans.size() != 0) {
|
||||
ActivityBean activityBean = activityBeans.get(0);
|
||||
setActivity(activityBean);
|
||||
}
|
||||
}else {
|
||||
cl3.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,11 +278,14 @@ public class SecondFragment extends BaseFragment {
|
||||
public void onNext(@NonNull BaseResponse<List<GoodsInfo>> listBaseResponse) {
|
||||
Log.e("getGoods", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
cl1.setVisibility(View.VISIBLE);
|
||||
List<GoodsInfo> goodsInfoList = listBaseResponse.data;
|
||||
if (goodsInfoList != null && goodsInfoList.size() != 0) {
|
||||
GoodsInfo goodsInfo = goodsInfoList.get(0);
|
||||
setGoodsInfo(goodsInfo);
|
||||
}
|
||||
}else {
|
||||
cl1.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,11 +321,14 @@ public class SecondFragment extends BaseFragment {
|
||||
public void onNext(@NonNull BaseResponse<List<ArticleInfo>> listBaseResponse) {
|
||||
Log.e("getArticle", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
cl2.setVisibility(View.VISIBLE);
|
||||
List<ArticleInfo> articleInfos = listBaseResponse.data;
|
||||
if (articleInfos != null && articleInfos.size() != 0) {
|
||||
ArticleInfo articleInfo = articleInfos.get(0);
|
||||
setArticleInfo(articleInfo);
|
||||
}
|
||||
}else {
|
||||
cl2.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/nodata.png
Normal file
BIN
app/src/main/res/drawable-hdpi/nodata.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -40,15 +40,33 @@
|
||||
app:layout_constraintStart_toStartOf="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
|
||||
android:id="@+id/iv1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_img"
|
||||
android:layout_width="152dp"
|
||||
android:layout_height="152dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView9"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView9" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goods_name"
|
||||
@@ -148,6 +166,7 @@
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -175,14 +194,32 @@
|
||||
app:layout_constraintStart_toStartOf="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
|
||||
android:id="@+id/iv2"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_aimg"
|
||||
android:layout_width="224dp"
|
||||
android:layout_height="126dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView13"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView13" />
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
@@ -219,6 +256,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -237,6 +275,19 @@
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_background">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv3"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -251,6 +302,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -294,6 +346,18 @@
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_background">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv3"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -308,6 +372,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
Reference in New Issue
Block a user