新增 playdash sg8 spin99 新增推送观看次数
This commit is contained in:
@@ -15,6 +15,10 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import java.security.Timestamp;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -84,6 +88,8 @@ public class MyNotifyListAdapter extends RecyclerView.Adapter<MyNotifyListAdapte
|
||||
holder.ivMsg.setVisibility(View.GONE);
|
||||
holder.tvTime.setText(messageInfo.getCreateTime());
|
||||
holder.tvJumpLink.setVisibility(View.GONE);
|
||||
|
||||
holder.lookIv.setText(longTime(messageInfo.getCreateTime()));
|
||||
if (!TextUtils.isEmpty(messageInfo.getImage())) {
|
||||
holder.ivMsg.setVisibility(View.VISIBLE);
|
||||
Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg);
|
||||
@@ -111,6 +117,23 @@ public class MyNotifyListAdapter extends RecyclerView.Adapter<MyNotifyListAdapte
|
||||
|
||||
}
|
||||
|
||||
public String longTime(String dateString){
|
||||
// 定义所需的日期格式
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
try {
|
||||
Long timeStr = dateFormat.parse(dateString).getTime();
|
||||
|
||||
String name = (((System.currentTimeMillis()-timeStr)/1000/60)+1000)+"";
|
||||
|
||||
return name;
|
||||
} catch (ParseException e) {
|
||||
return "1000";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listdata != null ? listdata.size() : 0;
|
||||
@@ -129,7 +152,7 @@ public class MyNotifyListAdapter extends RecyclerView.Adapter<MyNotifyListAdapte
|
||||
private final ImageView ivMsg;
|
||||
private ConstraintLayout root;
|
||||
private LinearLayout layoutMore;
|
||||
|
||||
private TextView lookIv;
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
root = itemView.findViewById(R.id.big_bg);
|
||||
@@ -143,6 +166,7 @@ public class MyNotifyListAdapter extends RecyclerView.Adapter<MyNotifyListAdapte
|
||||
tvTime = itemView.findViewById(R.id.tv_msg_time);
|
||||
tvJumpLink = itemView.findViewById(R.id.iv_notifyjumpclick);
|
||||
layoutMore = itemView.findViewById(R.id.layout_more);
|
||||
lookIv = itemView.findViewById(R.id.look_iv);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -95,6 +95,22 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_msg_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/look_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@mipmap/look_img"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:paddingStart="5dp"
|
||||
android:text="0"
|
||||
android:drawablePadding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_msg_title" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
BIN
base/src/main/res/mipmap-xxhdpi/look_img.png
Normal file
BIN
base/src/main/res/mipmap-xxhdpi/look_img.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Reference in New Issue
Block a user