| | |
| | | import com.weikou.beibeivideo.ui.video.IVideoClickListener; |
| | | import com.weikou.beibeivideo.ui.video.VideoColumn2Adapter; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.ad.ExpressAdManager; |
| | | import com.weikou.beibeivideo.widget.FullyGridLayoutManager; |
| | | import com.weikou.beibeivideo.R; |
| | |
| | | private ImageView video_more_image; |
| | | private LinearLayout video_introduction_more; |
| | | private FrameLayout fl_native_ad_1; |
| | | private LinearLayout ll_relative_video; |
| | | |
| | | public static boolean isShowMore = false;// 是否显示更多 |
| | | public static int page_varietyshow = 0;// 综艺节目的分页 |
| | |
| | | fl_native_ad_1 = contentView |
| | | .findViewById(R.id.fl_native_ad_1); |
| | | |
| | | ll_relative_video = contentView |
| | | .findViewById(R.id.ll_relative_video); |
| | | |
| | | contentView.findViewById(R.id.ll_container).setFocusable(true); |
| | | contentView.findViewById(R.id.ll_container).setFocusableInTouchMode(true); |
| | | |
| | |
| | | new TypeToken<List<VideoInfo>>() { |
| | | }.getType()); |
| | | |
| | | |
| | | final VideoColumn2Adapter adapter = new VideoColumn2Adapter(getActivity(), getContext(), videoInfos, false, 2, new IVideoClickListener() { |
| | | @Override |
| | | public void onClick(VideoInfo video) { |
| | | ChangeVideoEvent changeVideoEvent = new ChangeVideoEvent(); |
| | | changeVideoEvent.setVideoInfo(video); |
| | | changeVideoEvent.setTag("VideoPlayerFragment"); |
| | | EventBus.getDefault().post(changeVideoEvent); |
| | | } |
| | | }); |
| | | adapter.initRecyclerViewDisplayWidthColumn2(rv_video_related_video); |
| | | |
| | | if (getActivity() == null) |
| | | return; |
| | | getActivity().runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (rv_video_related_video != null) { |
| | | rv_video_related_video.setAdapter(adapter); |
| | | if (videoInfos == null || videoInfos.size() == 0) { |
| | | ll_relative_video.setVisibility(View.GONE); |
| | | } else { |
| | | ll_relative_video.setVisibility(View.VISIBLE); |
| | | final VideoColumn2Adapter adapter = new VideoColumn2Adapter(getActivity(), getContext(), videoInfos, false, 2, new IVideoClickListener() { |
| | | @Override |
| | | public void onClick(VideoInfo video) { |
| | | ChangeVideoEvent changeVideoEvent = new ChangeVideoEvent(); |
| | | changeVideoEvent.setVideoInfo(video); |
| | | changeVideoEvent.setTag("VideoPlayerFragment"); |
| | | EventBus.getDefault().post(changeVideoEvent); |
| | | } |
| | | if (adRunnable != null) |
| | | rv_video_related_video.post(adRunnable); |
| | | } |
| | | }); |
| | | }); |
| | | adapter.initRecyclerViewDisplayWidthColumn2(rv_video_related_video); |
| | | |
| | | if (getActivity() == null) |
| | | return; |
| | | getActivity().runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (rv_video_related_video != null) { |
| | | rv_video_related_video.setAdapter(adapter); |
| | | } |
| | | if (adRunnable != null) |
| | | rv_video_related_video.post(adRunnable); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | |
| | | */ |
| | | // 加载播放页第二条广告 |
| | | private void loadAD2() { |
| | | new ExpressAdManager(ExpressAdManager.SOURCE_GDT2, getContext()).loadVideoDetailRelativeVideoBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | new ExpressAdManager(AdUtil.AD_TYPE.gdt2, getContext()).loadVideoDetailRelativeVideoBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null && adList.size() > 0) |