| | |
| | | import android.widget.TextView; |
| | | |
| | | import com.bumptech.glide.Glide; |
| | | import com.bumptech.glide.request.RequestOptions; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.lcjian.library.util.glide.GlideRoundTransform; |
| | | import com.lcjian.library.widget.RatioLayout; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.VideoInfo; |
| | | import com.weikou.beibeivideo.entity.vo.WatchHistoryVO; |
| | |
| | | |
| | | if (StringUtils.isEmpty(videoInfo.getPicture())) |
| | | videoInfo.setPicture(""); |
| | | try { |
| | | Glide.with(context).load(videoInfo.getPicture()) |
| | | .placeholder(R.drawable.ic_default_cover) |
| | | .error(R.drawable.ic_default_cover).into(viewHolder.iv_cover); |
| | | } catch (IllegalArgumentException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | viewHolder.rl_picture.setTag(videoInfo.getPicture()); |
| | | viewHolder.rl_picture.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | Glide.with(context).load(viewHolder.rl_picture.getTag() + "").apply(new RequestOptions().centerCrop()).transform(new GlideRoundTransform(context, 6)) |
| | | .placeholder(R.drawable.shape_video_list_cover_placeholder).into(viewHolder.iv_cover); |
| | | } catch (IllegalArgumentException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | private void getVideoDetail(WatchHistoryVO vo, |
| | |
| | | holder.chb_delete = (CheckBox) view.findViewById(R.id.chb_delete); |
| | | holder.fl_video_select = (FrameLayout) view |
| | | .findViewById(R.id.fl_video_select); |
| | | holder.rl_picture = view |
| | | .findViewById(R.id.rl_picture); |
| | | view.setTag(holder); |
| | | } |
| | | |
| | |
| | | }); |
| | | holder.chb_delete.setChecked(mSelectedIds.contains(vo.getId())); |
| | | } |
| | | holder.iv_cover.setImageResource(R.drawable.ic_default_cover); |
| | | holder.tv_title.setText(""); |
| | | getVideoDetail(vo, |
| | | holder); |
| | |
| | | ImageButton btn_delete; |
| | | CheckBox chb_delete; |
| | | FrameLayout fl_video_select; |
| | | RatioLayout rl_picture; |
| | | } |
| | | |
| | | public Set<String> getSelectedIds() { |