diff --git a/app/build.gradle b/app/build.gradle index 398af50b..c41cc1e3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -152,6 +152,9 @@ dependencies { //阿里云IOT implementation ('com.aliyun.alink.linksdk:lp-iot-linkkit:1.7.3.2') + + implementation 'com.github.SheHuan:NiceImageView:1.0.5' + //MQTT // implementation files('libs\\org.eclipse.paho.android.service-1.1.1.jar') // implementation files('libs\\org.eclipse.paho.client.mqttv3-1.2.5.jar') diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/adapter/good_adapter.java b/app/src/main/java/com/bonait/bnframework/modules/home/adapter/good_adapter.java index e02438fb..5baa2693 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/adapter/good_adapter.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/adapter/good_adapter.java @@ -7,6 +7,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -74,25 +75,29 @@ public class good_adapter extends RecyclerView.Adapter if (isCloud) { myViewHolder.Sc_text.setText("下载"); + myViewHolder.sc_layout.setImageResource(R.mipmap.yxz); myViewHolder.delete_text.setVisibility(View.GONE); myViewHolder.sc_image.setVisibility(View.GONE); if (mode.getIsdownload()) { myViewHolder.Sc_text.setVisibility(View.GONE); + myViewHolder.sc_layout.setVisibility(View.GONE); } - } else { myViewHolder.Sc_text.setText("上传"); - + myViewHolder.sc_layout.setImageResource(R.mipmap.ysc); if (ConfigName.getInstance().user.userID.equals("研发用户")) { myViewHolder.sc_image.setVisibility(View.GONE); myViewHolder.delete_text.setVisibility(View.VISIBLE); myViewHolder.Sc_text.setVisibility(View.VISIBLE); + myViewHolder.sc_layout.setVisibility(View.VISIBLE); + }else { myViewHolder.sc_image.setVisibility(View.GONE); myViewHolder.delete_text.setVisibility(View.GONE); myViewHolder.Sc_text.setVisibility(View.GONE); + myViewHolder.sc_layout.setVisibility(View.GONE); } } myViewHolder.tvTag.setText(name); @@ -102,7 +107,7 @@ public class good_adapter extends RecyclerView.Adapter myBitmapUtils.disPlay(myViewHolder.ImageUrl, url); } //上传按钮点击 - myViewHolder.Sc_text.setOnClickListener(new View.OnClickListener() { + myViewHolder.shangchuang.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (isCloud) { @@ -177,9 +182,9 @@ public class good_adapter extends RecyclerView.Adapter public void SetImage(ImageView image, boolean isxz) { if (isxz) { - image.setImageResource(R.mipmap.sc3); + image.setImageResource(R.mipmap.sc_yes1); } else { - image.setImageResource(R.mipmap.wsc3); + image.setImageResource(R.mipmap.sc_no1); } } @@ -220,9 +225,10 @@ public class good_adapter extends RecyclerView.Adapter } public static class MyLCViewHolder1 extends RecyclerView.ViewHolder { - private TextView tvTag, tvNote, tvAccount, Sc_text, delete_text; + private TextView tvTag, tvNote, tvAccount, Sc_text; - private ImageView ImageUrl;//图片 + public RelativeLayout delete_text,shangchuang; + private ImageView ImageUrl,sc_layout;//图片 private ImageView sc_image;//是否收藏 @@ -234,9 +240,11 @@ public class good_adapter extends RecyclerView.Adapter tvTag = view.findViewById(R.id.Tag_text); tvNote = view.findViewById(R.id.Note_text); Sc_text = view.findViewById(R.id.Sc_text); + sc_layout=view.findViewById(R.id.sc_layout); delete_text = view.findViewById(R.id.delete_text); sc_image = view.findViewById(R.id.sc_image);//收藏 ImageUrl = view.findViewById(R.id.ImageUrl);//图片 + shangchuang= view.findViewById(R.id.shangchuang); } } } diff --git a/app/src/main/res/drawable/yjyy.xml b/app/src/main/res/drawable/yjyy.xml new file mode 100644 index 00000000..af36645b --- /dev/null +++ b/app/src/main/res/drawable/yjyy.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item/layout/good_show.xml b/app/src/main/res/layout/item/layout/good_show.xml index 5d1d74a5..817dfefc 100644 --- a/app/src/main/res/layout/item/layout/good_show.xml +++ b/app/src/main/res/layout/item/layout/good_show.xml @@ -1,91 +1,173 @@ + - + + - + android:layout_height="match_parent" + android:orientation="vertical"> + - + + + android:layout_height="match_parent" + app:cardCornerRadius="0dp"> + + + + + + + + + + + + - + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:textColor="@color/gray" + android:textSize="10dp" + android:visibility="gone" + tools:ignore="MissingConstraints" /> + + android:layout_marginTop="5dp" + android:layout_marginRight="5dp" + android:src="@mipmap/sc_no1" /> \ No newline at end of file diff --git a/app/src/main/res/mipmap-xxxhdpi/sc_no1.png b/app/src/main/res/mipmap-xxxhdpi/sc_no1.png new file mode 100644 index 00000000..99dbd74c Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/sc_no1.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/sc_yes1.png b/app/src/main/res/mipmap-xxxhdpi/sc_yes1.png new file mode 100644 index 00000000..335c8cec Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/sc_yes1.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ysc.png b/app/src/main/res/mipmap-xxxhdpi/ysc.png new file mode 100644 index 00000000..2ac5626e Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ysc.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ysc1.png b/app/src/main/res/mipmap-xxxhdpi/ysc1.png new file mode 100644 index 00000000..8a117f21 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ysc1.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/yxz.png b/app/src/main/res/mipmap-xxxhdpi/yxz.png new file mode 100644 index 00000000..bceb80e2 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/yxz.png differ