| | |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.CheckBox; |
| | | import android.widget.FrameLayout; |
| | | import android.widget.HorizontalScrollView; |
| | | import android.widget.ImageView; |
| | | import android.widget.LinearLayout; |
| | | import android.widget.TextView; |
| | |
| | | info = mList.get(position); |
| | | } |
| | | ViewHolder viewHolder = (ViewHolder) holder; |
| | | viewHolder.ll_recommend_gv.setVisibility(View.GONE); |
| | | viewHolder.ll_item1.setVisibility(View.VISIBLE); |
| | | |
| | | if (!isFirst) { |
| | | if ((haveHeaderView() && position % 2 == 1) || |
| | | (!haveHeaderView() && position % 2 == 0)) { |
| | | // Log.e("mResult", "position:" + position); |
| | | viewHolder.v_left.setVisibility(View.VISIBLE); |
| | | } else { |
| | | viewHolder.v_left.setVisibility(View.GONE); |
| | | } |
| | | } else { |
| | | viewHolder.v_left.setVisibility(View.GONE); |
| | | } |
| | | |
| | | |
| | | |
| | | /**********************************更具需求不在是搜索结果页才显示商铺名字*************/ |
| | |
| | | // viewHolder.ll_shop.setVisibility(View.GONE); |
| | | // } |
| | | |
| | | GoodsDetailListUtil.setGoodsDetail(mContext,info,viewHolder.goodsDetail); |
| | | GoodsDetailListUtil.setGoodsDetail(mContext, info, viewHolder.goodsDetail); |
| | | |
| | | // 图片 |
| | | Glide.with(mContext).load(info.getPicUrl()). |
| | | 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) { |
| | | if (!StringUtils.isEmpty(type)) |
| | | CategoryCustomEvent.classGoods(mContext, type); |
| | | Intent intent= new Intent(mContext, GoodsDetailActivity.class); |
| | | Intent intent = new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", info.getGoodsId()); |
| | | intent.putExtra("goodsType", info.getGoodsType()); |
| | | intent.putExtra("title", info.getTitle()); |
| | |
| | | |
| | | |
| | | 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; |
| | | View itemView; |
| | | ImageView iv_pic; |
| | | ImageView iv_pic1; |
| | | ImageView iv_close; |
| | | View v_left; |
| | | TextView tv_shop_name1; |
| | | LinearLayout ll_shop1; |
| | | LinearLayout ll_item1; |
| | | |
| | | GoodsRightViewHolder goodsDetail; |
| | | |
| | | public ViewHolder(View convertView) { |
| | | super(convertView); |
| | | /* |
| | | 竖屏 |
| | | */ |
| | | itemView = convertView; |
| | | goodsDetail = new GoodsRightViewHolder(convertView); |
| | | iv_pic = convertView |
| | | .findViewById(R.id.iv_movie_cover); |
| | | iv_pic1 = convertView |
| | | .findViewById(R.id.iv_movie_cover1); |
| | | tv_normal_price = convertView |
| | | .findViewById(R.id.tv_normal_price); |
| | | tv_shop_name = convertView |
| | | .findViewById(R.id.tv_shop_name2); |
| | | 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_shop2); |
| | | |
| | | /* |
| | | 横屏 |
| | | */ |
| | | v_left = convertView.findViewById(R.id.v_left); |
| | | ll_item1 = convertView.findViewById(R.id.ll_horizontal_item); |
| | | tv_shop_name1 = convertView |
| | | .findViewById(R.id.tv_shop_name1); |
| | | ll_shop1 = convertView.findViewById(R.id.ll_shop1); |
| | | iv_close = convertView.findViewById(R.id.iv_close); |
| | | .findViewById(R.id.iv_pic); |
| | | } |
| | | } |
| | | |