admin
2020-08-14 bbe126bc62902f3bb5d6d9db48d398efcb7f98c4
BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeAdapter2.java
@@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.List;
import android.graphics.Color;
import android.text.TextUtils;
import android.text.TextUtils.TruncateAt;
import android.view.Gravity;
@@ -79,30 +80,28 @@
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_episode, null);
        TextView tv_episode = (TextView) convertView.findViewById(R.id.tv_episode);
        TextView tv_episode = convertView.findViewById(R.id.tv_episode);
        VideoDetailInfo videoDetailInfo = (VideoDetailInfo) getItem(position);
        // 此处的position 从0开始 mPlayingPosition为12时 position应该是从1-12
        // mPlayingPosition为18时 position应该是从7-18
        if (mPlayingPosition >= 12 && position == mList.size() - 1) {// 用户选择大于12集以上内容时
            tv_episode.setBackgroundResource(R.drawable.episode_playing);
            tv_episode.setTextColor(parent.getResources()
                    .getColor(android.R.color.black));
            tv_episode.setBackgroundResource(R.drawable.shape_video_detail_episode_selected);
            tv_episode.setTextColor(Color.parseColor("#FFFFFF"));
        } else if (position == mPlayingPosition) {
            tv_episode
                    .setBackgroundResource(R.drawable.episode_playing);
//            tv_episode.setTextColor(parent.getResources()
//                    .getColor(android.R.color.black));
                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());