| | |
| | | package com.weikou.beibeivideo.ui.media; |
| | | |
| | | import android.graphics.Color; |
| | | import android.text.TextUtils; |
| | | import android.text.TextUtils.TruncateAt; |
| | | import android.view.Gravity; |
| | |
| | | @Override |
| | | public View getView(int position, View view, ViewGroup parent) { |
| | | view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_episode, null); |
| | | TextView tv_episode = (TextView) view.findViewById(R.id.tv_episode); |
| | | |
| | | TextView tv_episode = view.findViewById(R.id.tv_episode); |
| | | VideoDetailInfo videoDetailInfo = (VideoDetailInfo) getItem(position); |
| | | //设置样式 |
| | | if (position == mPlayingPosition) { |
| | | tv_episode.setBackgroundResource(R.drawable.episode_playing); |
| | | // tv_episode.setTextColor(parent.getResources() |
| | | // .getColor(R.color.yellow)); |
| | | tv_episode.setBackgroundResource(R.drawable.shape_video_detail_episode_selected); |
| | | tv_episode.setTextColor(Color.parseColor("#FFFFFF")); |
| | | } else { |
| | | if (TextUtils.isEmpty(DownloadUtils.getOfflinePath( |
| | | parent.getContext(), mVideoInfo.getId(), |
| | | videoDetailInfo.getId()))) { |
| | | tv_episode.setBackgroundResource(R.drawable.episode_offlined); |
| | | // tv_episode.setTextColor(parent.getResources() |
| | | // .getColor(android.R.color.white)); |
| | | } |
| | | tv_episode.setBackgroundResource(R.drawable.episode_unwatched); |
| | | // tv_episode.setTextColor(parent.getResources() |
| | | // .getColor(android.R.color.black)); |
| | | tv_episode.setBackgroundResource(R.drawable.shape_video_detail_episode_unselected); |
| | | tv_episode.setTextColor(Color.parseColor("#232323")); |
| | | } |
| | | if (mVideoInfo.getShowType() == 1) { |
| | | // ((TextView) convertView).setText(videoDetailInfo.getName()); |