| | |
| | | import com.lcjian.library.util.common.ConnectionUtils; |
| | | import com.mozillaonline.providers.DownloadManager; |
| | | import com.mozillaonline.providers.downloads.Downloads; |
| | | import com.yeshi.buwanshequ.R; |
| | | import com.nostra13.universalimageloader.core.DisplayImageOptions; |
| | | import com.nostra13.universalimageloader.core.ImageLoader; |
| | | import com.nostra13.universalimageloader.core.assist.ImageScaleType; |
| | | import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.db.DownloadTable; |
| | | import com.weikou.beibeivideo.entity.VideoDetailInfo; |
| | | import com.weikou.beibeivideo.entity.VideoInfo; |
| | | import com.weikou.beibeivideo.ui.media.VideoDetailActivity; |
| | | import com.weikou.beibeivideo.ui.media.VideoDetailActivity2; |
| | | import com.weikou.beibeivideo.util.DownloadUtils; |
| | | import com.weikou.beibeivideo.util.VideoUtil; |
| | | |
| | | public class DownLoadAdapter extends CursorAdapter { |
| | | public interface IGetDeleteCallback { |
| | |
| | | int playingPosition = 0; |
| | | for (int i = 0; i < videoInfo.getVideoDetailList() |
| | | .size(); i++) { |
| | | VideoDetailInfo item = videoInfo |
| | | .getVideoDetailList().get(i); |
| | | VideoDetailInfo item =videoInfo.getVideoDetailList().get(i); |
| | | if (item.getId().equals(videoDetailId)) { |
| | | playingPosition = i; |
| | | break; |
| | | } |
| | | } |
| | | Intent intent = new Intent(v.getContext(), |
| | | VideoDetailActivity.class); |
| | | VideoDetailActivity2.class); |
| | | if (!TextUtils.isEmpty(DownloadUtils |
| | | .getOfflinePath(v.getContext(), videoId, |
| | | videoDetailId))) { |
| | |
| | | intent.putExtra("video_info", videoInfo); |
| | | intent.putExtra("playing_position", |
| | | playingPosition); |
| | | intent.putExtra("from", "download"); |
| | | con.startActivity(intent); |
| | | } else { |
| | | if (!ConnectionUtils.isNetworkAvailable(v |
| | |
| | | .get(videoDetailId); |
| | | if (videoInfo != null) { |
| | | int playingPosition = 0; |
| | | for (int i = 0; i < videoInfo |
| | | .getVideoDetailList().size(); i++) { |
| | | VideoDetailInfo item = videoInfo |
| | | .getVideoDetailList().get(i); |
| | | for (int i = 0; i < videoInfo.getVideoDetailList().size(); i++) { |
| | | VideoDetailInfo item = videoInfo.getVideoDetailList().get(i); |
| | | if (item.getId().equals(videoDetailId)) { |
| | | playingPosition = i; |
| | | break; |
| | | } |
| | | } |
| | | Intent intent = new Intent(v.getContext(), |
| | | VideoDetailActivity.class); |
| | | VideoDetailActivity2.class); |
| | | intent.putExtra("orientation_landscape", true); |
| | | intent.putExtra("video_info", videoInfo); |
| | | intent.putExtra("playing_position", |
| | | playingPosition); |
| | | intent.putExtra("from", "download"); |
| | | v.getContext().startActivity(intent); |
| | | } |
| | | } |
| | |
| | | try { |
| | | glide.load(videoInfo.getPicture()) |
| | | .placeholder(R.drawable.ic_default_cover) |
| | | .error(R.drawable.ic_default_cover).crossFade() |
| | | .error(R.drawable.ic_default_cover) |
| | | .into(iconView); |
| | | }catch (IllegalArgumentException e){ |
| | | e.printStackTrace(); |
| | |
| | | // iconView, options); |
| | | glide.load(videoInfo.getPicture()) |
| | | .placeholder(R.drawable.ic_default_cover) |
| | | .error(R.drawable.ic_default_cover).crossFade() |
| | | .error(R.drawable.ic_default_cover) |
| | | .into(iconView); |
| | | } |
| | | } |