|
@@ -11,7 +11,6 @@ import android.widget.TextView;
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.NonNull;
|
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.Nullable;
|
|
|
-import androidx.appcompat.widget.AppCompatImageView;
|
|
|
|
|
|
|
|
|
|
import com.bumptech.glide.Glide;
|
|
import com.bumptech.glide.Glide;
|
|
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
|
@@ -25,6 +24,7 @@ import com.itant.shibei.base.ItemLongClickListener;
|
|
|
import com.itant.shibei.constant.ConstantString;
|
|
import com.itant.shibei.constant.ConstantString;
|
|
|
import com.itant.shibei.manager.UserInfoManager;
|
|
import com.itant.shibei.manager.UserInfoManager;
|
|
|
import com.itant.shibei.tool.StringTool;
|
|
import com.itant.shibei.tool.StringTool;
|
|
|
|
|
+import com.makeramen.roundedimageview.RoundedImageView;
|
|
|
import com.miekir.common.utils.ActivityTool;
|
|
import com.miekir.common.utils.ActivityTool;
|
|
|
import com.miekir.common.utils.ToastTool;
|
|
import com.miekir.common.utils.ToastTool;
|
|
|
|
|
|
|
@@ -56,9 +56,9 @@ public class GoodsAdapter extends BaseQuickAdapter<GoodsBean, BaseViewHolder> {
|
|
|
holder.setText(R.id.tv_good_comment,
|
|
holder.setText(R.id.tv_good_comment,
|
|
|
String.format(ConstantString.GOOD_COMMENT, Math.round(goodsBean.goodCommentPercent*100)));
|
|
String.format(ConstantString.GOOD_COMMENT, Math.round(goodsBean.goodCommentPercent*100)));
|
|
|
|
|
|
|
|
- // 月销
|
|
|
|
|
- holder.setText(R.id.tv_sales_per_month,
|
|
|
|
|
- String.format(ConstantString.SALES_PER_MONTH, String.valueOf(goodsBean.salesPerMonth)));
|
|
|
|
|
|
|
+ // 评论条数
|
|
|
|
|
+ holder.setText(R.id.tv_comment_num,
|
|
|
|
|
+ String.format(ConstantString.COMMENT_NUM, StringTool.getNumberString(goodsBean.commentNum)));
|
|
|
|
|
|
|
|
// 返现
|
|
// 返现
|
|
|
TextView tv_rebate = holder.getView(R.id.tv_rebate);
|
|
TextView tv_rebate = holder.getView(R.id.tv_rebate);
|
|
@@ -101,7 +101,7 @@ public class GoodsAdapter extends BaseQuickAdapter<GoodsBean, BaseViewHolder> {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 解决图片错乱
|
|
// 解决图片错乱
|
|
|
- AppCompatImageView aciv_goods = holder.getView(R.id.aciv_goods);
|
|
|
|
|
|
|
+ RoundedImageView aciv_goods = holder.getView(R.id.aciv_goods);
|
|
|
aciv_goods.setTag(R.id.aciv_goods, goodsBean.coverImageUrl);
|
|
aciv_goods.setTag(R.id.aciv_goods, goodsBean.coverImageUrl);
|
|
|
Glide.with(mContext).load(goodsBean.coverImageUrl)
|
|
Glide.with(mContext).load(goodsBean.coverImageUrl)
|
|
|
.apply(RequestOptions.bitmapTransform(new RoundedCorners(mRadius)))
|
|
.apply(RequestOptions.bitmapTransform(new RoundedCorners(mRadius)))
|
|
@@ -113,6 +113,11 @@ public class GoodsAdapter extends BaseQuickAdapter<GoodsBean, BaseViewHolder> {
|
|
|
.into(new SimpleTarget<Drawable>() {
|
|
.into(new SimpleTarget<Drawable>() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onResourceReady(Drawable resource, Transition<? super Drawable> transition) {
|
|
public void onResourceReady(Drawable resource, Transition<? super Drawable> transition) {
|
|
|
|
|
+ if (resource == null) {
|
|
|
|
|
+ aciv_goods.setImageResource(R.mipmap.logo_gray);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String coverUrl = null;
|
|
String coverUrl = null;
|
|
|
try {
|
|
try {
|
|
|
coverUrl = (String) aciv_goods.getTag(R.id.aciv_goods);
|
|
coverUrl = (String) aciv_goods.getTag(R.id.aciv_goods);
|