| | |
| | | import com.nostra13.universalimageloader.core.DisplayImageOptions; |
| | | import com.nostra13.universalimageloader.core.assist.ImageScaleType; |
| | | import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; |
| | | import com.tejia.lijin.app.ui.recommend.GoodsDetailActivity; |
| | | import com.wpc.library.util.common.DimenUtils; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | import com.tejia.lijin.app.R; |
| | |
| | | View view = LayoutInflater.from(mContext).inflate(R.layout.item_yellow_notice, parent, false); |
| | | return new ViewHolderNotifyCation(view); |
| | | } else { |
| | | View view = LayoutInflater.from(mContext).inflate(R.layout.item_category, parent, false); |
| | | View view = LayoutInflater.from(mContext).inflate(R.layout.item_goods, parent, false); |
| | | ViewHolder holder = new ViewHolder(view); |
| | | return holder; |
| | | } |
| | |
| | | RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) notify.ll_notice.getLayoutParams(); |
| | | layoutParams.height = DimenUtils.dip2px(mContext, 30); |
| | | layoutParams.topMargin = DimenUtils.dip2px(mContext, 10); |
| | | layoutParams.leftMargin = DimenUtils.dip2px(mContext, 10); |
| | | layoutParams.rightMargin = DimenUtils.dip2px(mContext, 10); |
| | | } |
| | | |
| | | } else if (!isHeaderView(position) && !isFooterView(position)) { |
| | |
| | | } |
| | | |
| | | ViewHolder viewHolder = (ViewHolder) holder; |
| | | viewHolder.ll_recommend_gv.setVisibility(View.GONE); |
| | | viewHolder.ll_item1.setVisibility(View.VISIBLE); |
| | | viewHolder.v_top.setVisibility(View.VISIBLE); |
| | | |
| | | if ((haveHeaderView() && position == 1) || (!haveHeaderView() && position == 0)) { |
| | | viewHolder.v_top.setVisibility(View.VISIBLE); |
| | | } else { |
| | | viewHolder.v_top.setVisibility(View.GONE); |
| | | } |
| | | |
| | | viewHolder.v_top.setVisibility(View.GONE); |
| | | viewHolder.v_top1.setVisibility(View.VISIBLE); |
| | | viewHolder.v_left.setVisibility(View.GONE); |
| | | |
| | | //商品详情填充 |
| | | GoodsDetailListUtil.setGoodsDetail(mContext, info, viewHolder.goodsDetail); |
| | | // 图片 |
| | |
| | | placeholder(R.drawable.ic_goods_default).error(R.drawable.ic_goods_default). |
| | | transform(new GlideRoundTransform(mContext, 5)) |
| | | .diskCacheStrategy(DiskCacheStrategy.ALL) |
| | | .into(viewHolder.iv_pic1); |
| | | .into(viewHolder.iv_pic); |
| | | |
| | | viewHolder.ll_item1.setOnClickListener(new View.OnClickListener() { |
| | | viewHolder.itemView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | // Intent intent = new Intent(mContext, GoodsDetailBrowerActivity.class); |
| | | if (!StringUtils.isEmpty(type)) |
| | | CategoryCustomEvent.classGoods(mContext, type); |
| | | Intent intent = GoodsDetailJumpUtil.getGoodsDetailIntent(mContext, info.getGoodsType()); |
| | | Intent intent= new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", info.getGoodsId()); |
| | | intent.putExtra("goodsType", info.getGoodsType()); |
| | | |
| | | intent.putExtra("title", info.getTitle()); |
| | | intent.putExtra("id", info.getGoodsId()); |
| | | intent.putExtra("from", from); |
| | | mContext.startActivity(intent); |
| | | } |
| | |
| | | |
| | | |
| | | class ViewHolder extends RecyclerView.ViewHolder { |
| | | TextView tv_name; |
| | | TextView tv_price; |
| | | TextView tv_coupon_price; |
| | | LinearLayout ll_coupon_bg; |
| | | TextView tv_shop_name; |
| | | LinearLayout ll_coupon; |
| | | LinearLayout ll_shop; |
| | | TextView tv_normal_price; |
| | | LinearLayout ll_recommend_gv; |
| | | TextView tv_favourable;//红包,券后价 |
| | | TextView tv_sale_num; |
| | | ImageView iv_pic; |
| | | View v_top; |
| | | View v_top1; |
| | | View v_left; |
| | | LinearLayout ll_item1; |
| | | ImageView iv_pic1; |
| | | |
| | | GoodsRightViewHolder goodsDetail; |
| | | |
| | | public ViewHolder(View convertView) { |
| | |
| | | */ |
| | | goodsDetail = new GoodsRightViewHolder(convertView); |
| | | iv_pic = convertView |
| | | .findViewById(R.id.iv_movie_cover); |
| | | tv_normal_price = convertView |
| | | .findViewById(R.id.tv_normal_price); |
| | | tv_shop_name = convertView |
| | | .findViewById(R.id.tv_shop_name); |
| | | tv_name = convertView |
| | | .findViewById(R.id.tv_movie_title); |
| | | tv_price = convertView.findViewById(R.id.tv_price); |
| | | ll_coupon_bg = convertView.findViewById(R.id.ll_coupon_bg); |
| | | tv_coupon_price = convertView.findViewById(R.id.tv_coupon_price); |
| | | ll_coupon = convertView.findViewById(R.id.ll_coupon); |
| | | ll_recommend_gv = convertView.findViewById(R.id.ll_recommend_gv); |
| | | tv_favourable = convertView.findViewById(R.id.tv_favourable); |
| | | tv_sale_num = convertView.findViewById(R.id.tv_sale_num); |
| | | ll_shop = convertView.findViewById(R.id.ll_shop); |
| | | /* |
| | | 横屏 |
| | | */ |
| | | v_top = convertView.findViewById(R.id.v_top); |
| | | v_top1 = convertView.findViewById(R.id.v_top1); |
| | | v_left = convertView.findViewById(R.id.v_left); |
| | | ll_item1 = convertView.findViewById(R.id.ll_horizontal_item); |
| | | iv_pic1 = convertView |
| | | .findViewById(R.id.iv_movie_cover1); |
| | | .findViewById(R.id.iv_pic); |
| | | |
| | | |
| | | } |