| | |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.FrameLayout; |
| | | import android.widget.ImageView; |
| | | import android.widget.LinearLayout; |
| | | import android.widget.TextView; |
| | |
| | | import com.tejia.lijin.app.util.ui.HomeUIUtil; |
| | | import com.tejia.lijin.app.util.umengCustomEvent.MainCustomEvent; |
| | | import com.wpc.library.util.SystemCommon; |
| | | import com.wpc.library.util.common.DimenUtils; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | |
| | | import java.util.List; |
| | |
| | | * 推荐圆形专题 |
| | | */ |
| | | public class RecommendCircleSpecialAdapter extends RecyclerView.Adapter { |
| | | |
| | | public final static int SPCAE_DP = 14; |
| | | |
| | | private Activity mContext; |
| | | private List<SpecialOffer2> mList; |
| | |
| | | holder.iv_tag.setVisibility(View.GONE); |
| | | } |
| | | |
| | | int itemWidth = (int) (SystemCommon.getScreenWidth(mContext) / 5); |
| | | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, |
| | | int itemWidth = (int) ((SystemCommon.getScreenWidth(mContext) - DimenUtils.dip2px(mContext, 10) * 2 - DimenUtils.dip2px(mContext, SPCAE_DP) * 3) / 4); |
| | | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(itemWidth, |
| | | ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | holder.view.setLayoutParams(params); |
| | | |
| | | |
| | | if (!StringUtils.isNullOrEmpty(info.getBgColor())) { |
| | | holder.view.setBackground(HomeUIUtil.getCircleSpecialBg(mContext, info.getBgColor())); |
| | | holder.fl_content.setBackground(HomeUIUtil.getCircleSpecialBg(mContext, info.getBgColor())); |
| | | } |
| | | |
| | | holder.view.setOnClickListener(new View.OnClickListener() { |
| | |
| | | |
| | | class Holder extends RecyclerView.ViewHolder { |
| | | |
| | | FrameLayout fl_content; |
| | | TextView tv_name; |
| | | ImageView iv_icon; |
| | | ImageView iv_tag; |
| | |
| | | public Holder(View itemView) { |
| | | super(itemView); |
| | | view = itemView; |
| | | 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); |