| | |
| | | */ |
| | | public class RecommendCircleSpecialAdapter extends RecyclerView.Adapter { |
| | | |
| | | public final static int SPCAE_DP = 14; |
| | | public final static int SPCAE_DP = 11; |
| | | |
| | | private Activity mContext; |
| | | private List<SpecialOffer2> mList; |
| | |
| | | @Override |
| | | public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, final int position) { |
| | | final SpecialOffer2 info = mList.get(position); |
| | | info.setBgColor("#8B4CFF"); |
| | | if (StringUtils.isNullOrEmpty(info.getBgColor())) |
| | | info.setBgColor("#FFFFFF"); |
| | | Holder holder = (Holder) viewHolder; |
| | | holder.tv_name.setText(info.getName() + ""); |
| | | Glide.with(mContext).load(info.getPicture()).transform(new GlideRoundTransform(mContext, 18)).into(holder.iv_icon); |
| | |
| | | holder.iv_tag.setVisibility(View.GONE); |
| | | } |
| | | |
| | | int itemWidth = (int) ((SystemCommon.getScreenWidth(mContext) - DimenUtils.dip2px(mContext, 10) * 2 - DimenUtils.dip2px(mContext, SPCAE_DP) * 3) / 4); |
| | | int itemWidth = (int) ((SystemCommon.getScreenWidth(mContext) - DimenUtils.dip2px(mContext, 10) * 2 - DimenUtils.dip2px(mContext, SPCAE_DP) * 4) / 5); |
| | | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(itemWidth, |
| | | ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | holder.view.setLayoutParams(params); |
| | |
| | | public Holder(View itemView) { |
| | | super(itemView); |
| | | view = itemView; |
| | | fl_content=itemView.findViewById(R.id.fl_content); |
| | | fl_content = itemView.findViewById(R.id.fl_content); |
| | | tv_name = itemView.findViewById(R.id.tv_name); |
| | | iv_icon = itemView.findViewById(R.id.iv_icon); |
| | | iv_tag = itemView.findViewById(R.id.iv_tag); |