Browse Source

5555

tags/old_version_1
fyf 1 year ago
parent
commit
66a2b7e18d
9 changed files with 203 additions and 71 deletions
  1. +3
    -0
      app/build.gradle
  2. +15
    -7
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/good_adapter.java
  3. +39
    -0
      app/src/main/res/drawable/yjyy.xml
  4. +146
    -64
      app/src/main/res/layout/item/layout/good_show.xml
  5. BIN
     
  6. BIN
     
  7. BIN
     
  8. BIN
     
  9. BIN
     

+ 3
- 0
app/build.gradle View File

@@ -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')


+ 15
- 7
app/src/main/java/com/bonait/bnframework/modules/home/adapter/good_adapter.java View File

@@ -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<RecyclerView.ViewHolder>

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<RecyclerView.ViewHolder>
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<RecyclerView.ViewHolder>

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<RecyclerView.ViewHolder>
}

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<RecyclerView.ViewHolder>
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);
}
}
}


+ 39
- 0
app/src/main/res/drawable/yjyy.xml View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<!--按压状态下,前景变暗-->
<item android:state_pressed="true">
<layer-list>
<item android:left="4dp" android:top="4dp">
<shape>
<solid android:color="#f0f0f0" />
<corners android:radius="0dp" />
</shape>
</item>
</layer-list>
</item>

<!-- 非按下 -->
<item>
<layer-list>
<!-- 999渐变隐形外层 -->
<item android:left="0dp" android:top="0dp">
<shape>
<solid android:color="#79000000" />
<corners android:radius="2dp" />
</shape>
</item>
<!-- 777渐变阴影中层 -->
<item
android:bottom="1dp"
android:left="0dp"
android:right="0dp"
android:top="0dp">
<shape>
<solid android:color="#797373" />
<corners android:radius="0dp" />
</shape>
</item>
</layer-list>
</item>
</selector>

+ 146
- 64
app/src/main/res/layout/item/layout/good_show.xml View File

@@ -1,91 +1,173 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="165dp"
android:layout_height="165dp">

<LinearLayout
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:layout_marginBottom="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="120dp">
<ImageView
android:id="@+id/ImageUrl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@mipmap/image5"
android:adjustViewBounds="true"
android:scaleType="centerCrop"/>
android:layout_height="match_parent"
android:orientation="vertical">

<RelativeLayout
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#CCFFFFFF">
<TextView
android:id="@+id/Tag_text"
android:layout_height="120dp">

<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="三月瓜"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="25dp"
android:textStyle="bold"
android:maxLines="1"
tools:ignore="MissingConstraints" />
android:layout_height="match_parent"
app:cardCornerRadius="0dp">

<ImageView
android:id="@+id/ImageUrl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@mipmap/image5" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#99FFFFFF">

<TextView
android:id="@+id/Tag_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="三月瓜"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="25dp"
android:textStyle="bold"
tools:ignore="MissingConstraints" />
</RelativeLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>

</RelativeLayout>
</RelativeLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:orientation="horizontal">

<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">

<RelativeLayout
android:id="@+id/shangchuang"
android:layout_width="49dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:orientation="horizontal">

<TextView
android:id="@+id/Sc_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="上传"
android:textAlignment="center"
android:textColor="@color/light_blue_primary"
android:textSize="19dp" />

<TextView
android:id="@+id/delete_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_weight="1"
android:text="删除"
android:textAlignment="center"
android:textColor="@color/red_primary_dark"
android:textSize="19dp" />
<ImageView
android:id="@+id/sc_layout"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentBottom="true"
android:src="@mipmap/ysc" />

<TextView
android:id="@+id/Sc_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:text="上传"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="12dp" />
</RelativeLayout>
</RelativeLayout>

<RelativeLayout
android:id="@+id/delete_text"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">

<RelativeLayout
android:layout_width="49dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true">

<ImageView
android:layout_width="25dp"
android:layout_height="22dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="2dp"
android:src="@mipmap/ysc1" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:text="删除"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="12dp" />
</RelativeLayout>
</RelativeLayout>
<!-- <TextView-->
<!-- android:id="@+id/Sc_text"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_weight="1"-->
<!-- android:text="上传"-->
<!-- android:textAlignment="center"-->
<!-- android:textColor="@color/light_blue_primary"-->
<!-- android:textSize="19dp" />-->

<!-- <TextView-->
<!-- android:id="@+id/delete_text"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:layout_weight="1"-->
<!-- android:text="删除"-->
<!-- android:textAlignment="center"-->
<!-- android:textColor="@color/red_primary_dark"-->
<!-- android:textSize="19dp" />-->
</LinearLayout>
</LinearLayout>
</LinearLayout>

<TextView
android:id="@+id/Note_text"
android:textSize="10dp"
android:textColor="@color/gray"
android:layout_marginLeft="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="MissingConstraints"
android:layout_marginLeft="5dp"
android:text="时间:185秒"
android:visibility="gone"/>
android:textColor="@color/gray"
android:textSize="10dp"
android:visibility="gone"
tools:ignore="MissingConstraints" />

<ImageView
android:id="@+id/sc_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:src="@mipmap/wsc3"
android:visibility="gone"/>
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:src="@mipmap/sc_no1" />
</RelativeLayout>

BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


Loading…
Cancel
Save