// Path: app/src/main/java/com/zmj/qvod/module/bean/VideoInfo.java
// public class VideoInfo implements Serializable {
//     public String title;
//     public String pic;
//     public String dataId;
//     public String score;
//     public String airTime;
//     public String moreURL;
//     public String loadType;
//     //    public String description;
// 
// }
// 
// Path: app/src/main/java/com/zmj/qvod/presenter/VideoInfoPresenter.java
// public class VideoInfoPresenter extends BeamBasePresenter<VideoInfoActivity> {
// 
//     private JCVideoPlayerStandard jcVideoPlay;
// 
//     private VideoRes videoRes;
//     private Subscription rxSubscription;
//     private VideoMoreAdapter adapter;
//     private View headView;
// 
//     TextViewExpandableAnimation tvExpand;
// 
//     @Override
//     protected void onCreateView(@NonNull VideoInfoActivity view) {
//         super.onCreateView(view);
//         getView().getSupportActionBar().setTitle(getView().getVideoInfo().title);
// 
//         initVideoPlay();
// 
//         setListView();
// 
//         initData();
// 
//     }
// 
//     private void initVideoPlay() {
//         jcVideoPlay = getView().getJcVideoPlay();
//         //
//         jcVideoPlay.thumbImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
//         jcVideoPlay.backButton.setVisibility(View.GONE);
//         jcVideoPlay.titleTextView.setVisibility(View.GONE);
//         jcVideoPlay.tinyBackImageView.setVisibility(View.GONE);
//         //设置视频占位图
//         ImageLoader.load(getView().getVideoInfo().pic, jcVideoPlay.thumbImageView, 320);
//     }
// 
//     private void playVideo() {
//         if (videoRes == null) return;
//         //
//         jcVideoPlay.setUp(videoRes.getVideoUrl(), JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, videoRes.title);
//         //自动播放
//         jcVideoPlay.startPlayLogic();
//         //点击全屏_禁用重力感应
//         JCVideoPlayer.FULLSCREEN_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
//     }
// 
//     private void setIntro() {
//         String dir = "导演：" + StringUtils.removeOtherCode(videoRes.director);
//         String act = "主演：" + StringUtils.removeOtherCode(videoRes.actors);
//         String des = dir + "\n" + act + "\n" + "简介：" + StringUtils.removeOtherCode(videoRes.description);
//         tvExpand.setText(des);
//     }
// 
//     private void setListView() {
//         adapter = new VideoMoreAdapter(getView());
//         getView().getListView().setAdapter(adapter);
//         GridLayoutManager manager = new GridLayoutManager(getView(), 3);
//         manager.setSpanSizeLookup(adapter.obtainGridSpanSizeLookUp(3));
//         getView().getListView().setLayoutManager(manager);
//         SpaceDecoration decoration = new SpaceDecoration(JUtils.dip2px(8));
//         decoration.setPaddingEdgeSide(true);
//         decoration.setPaddingStart(true);
//         decoration.setPaddingHeaderFooter(true);
//         getView().getListView().addItemDecoration(decoration);
//         //
//         headView = LayoutInflater.from(getView()).inflate(R.layout.include_intro, null);
//         tvExpand = ButterKnife.findById(headView, R.id.tv_expand);
//         adapter.addHeader(new RecyclerArrayAdapter.ItemView() {
//             @Override
//             public View onCreateView(ViewGroup parent) {
//                 return headView;
//             }
// 
//             @Override
//             public void onBindView(View headerView) {
// 
//             }
//         });
//         //
//         adapter.setOnItemClickListener(position -> {
//             VideoInfoActivity.actionStart(getView(), adapter.getItem(position));
//             getView().finish();
//         });
//     }
// 
//     private void initData() {
//         rxSubscription = HttpUtils.getInstance().getVideoServer().getVideoInfo(getView().getVideoInfo().dataId)
//                 .compose(RxUtil.rxSchedulerHelper())
//                 .compose(RxUtil.handleResult())
//                 .subscribe(videoRes -> {
//                             VideoInfoPresenter.this.videoRes = videoRes;
//                             //标题
//                             getView().getSupportActionBar().setTitle(videoRes.title);
//                             //
//                             playVideo();
//                             //
//                             setIntro();
//                             //
//                             if (videoRes.list.size() > 1)
//                                 adapter.addAll(videoRes.list.get(1).childList);
//                             else
//                                 adapter.addAll(videoRes.list.get(0).childList);
//                         },
//                         throwable -> {
//                             JUtils.Toast("加载失败");
//                         },
//                         () -> {
//                             //加载完成...
//                         });
//     }
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//         rxSubscription.unsubscribe();
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.jude.beam.bijection.RequiresPresenter;
import com.jude.beam.expansion.BeamBaseActivity;
import com.jude.easyrecyclerview.EasyRecyclerView;
import com.zmj.qvod.R;
import com.zmj.qvod.module.bean.VideoInfo;
import com.zmj.qvod.presenter.VideoInfoPresenter;
import butterknife.BindView;
import butterknife.ButterKnife;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;
package com.zmj.qvod.view.activity;




/**
 * Created by matt on 2017/3/24.
 */
@RequiresPresenter(VideoInfoPresenter.class)
public class VideoInfoActivity extends BeamBaseActivity<VideoInfoPresenter> {

    @BindView(R.id.jc_video_play)
    JCVideoPlayerStandard jcVideoPlay;
    @BindView(R.id.ev_more)
    EasyRecyclerView evMore;


// Path: app/src/main/java/com/zmj/qvod/module/bean/VideoInfo.java
// public class VideoInfo implements Serializable {
//     public String title;
//     public String pic;
//     public String dataId;
//     public String score;
//     public String airTime;
//     public String moreURL;
//     public String loadType;
//     //    public String description;
// 
// }
// 
// Path: app/src/main/java/com/zmj/qvod/presenter/VideoInfoPresenter.java
// public class VideoInfoPresenter extends BeamBasePresenter<VideoInfoActivity> {
// 
//     private JCVideoPlayerStandard jcVideoPlay;
// 
//     private VideoRes videoRes;
//     private Subscription rxSubscription;
//     private VideoMoreAdapter adapter;
//     private View headView;
// 
//     TextViewExpandableAnimation tvExpand;
// 
//     @Override
//     protected void onCreateView(@NonNull VideoInfoActivity view) {
//         super.onCreateView(view);
//         getView().getSupportActionBar().setTitle(getView().getVideoInfo().title);
// 
//         initVideoPlay();
// 
//         setListView();
// 
//         initData();
// 
//     }
// 
//     private void initVideoPlay() {
//         jcVideoPlay = getView().getJcVideoPlay();
//         //
//         jcVideoPlay.thumbImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
//         jcVideoPlay.backButton.setVisibility(View.GONE);
//         jcVideoPlay.titleTextView.setVisibility(View.GONE);
//         jcVideoPlay.tinyBackImageView.setVisibility(View.GONE);
//         //设置视频占位图
//         ImageLoader.load(getView().getVideoInfo().pic, jcVideoPlay.thumbImageView, 320);
//     }
// 
//     private void playVideo() {
//         if (videoRes == null) return;
//         //
//         jcVideoPlay.setUp(videoRes.getVideoUrl(), JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, videoRes.title);
//         //自动播放
//         jcVideoPlay.startPlayLogic();
//         //点击全屏_禁用重力感应
//         JCVideoPlayer.FULLSCREEN_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
//     }
// 
//     private void setIntro() {
//         String dir = "导演：" + StringUtils.removeOtherCode(videoRes.director);
//         String act = "主演：" + StringUtils.removeOtherCode(videoRes.actors);
//         String des = dir + "\n" + act + "\n" + "简介：" + StringUtils.removeOtherCode(videoRes.description);
//         tvExpand.setText(des);
//     }
// 
//     private void setListView() {
//         adapter = new VideoMoreAdapter(getView());
//         getView().getListView().setAdapter(adapter);
//         GridLayoutManager manager = new GridLayoutManager(getView(), 3);
//         manager.setSpanSizeLookup(adapter.obtainGridSpanSizeLookUp(3));
//         getView().getListView().setLayoutManager(manager);
//         SpaceDecoration decoration = new SpaceDecoration(JUtils.dip2px(8));
//         decoration.setPaddingEdgeSide(true);
//         decoration.setPaddingStart(true);
//         decoration.setPaddingHeaderFooter(true);
//         getView().getListView().addItemDecoration(decoration);
//         //
//         headView = LayoutInflater.from(getView()).inflate(R.layout.include_intro, null);
//         tvExpand = ButterKnife.findById(headView, R.id.tv_expand);
//         adapter.addHeader(new RecyclerArrayAdapter.ItemView() {
//             @Override
//             public View onCreateView(ViewGroup parent) {
//                 return headView;
//             }
// 
//             @Override
//             public void onBindView(View headerView) {
// 
//             }
//         });
//         //
//         adapter.setOnItemClickListener(position -> {
//             VideoInfoActivity.actionStart(getView(), adapter.getItem(position));
//             getView().finish();
//         });
//     }
// 
//     private void initData() {
//         rxSubscription = HttpUtils.getInstance().getVideoServer().getVideoInfo(getView().getVideoInfo().dataId)
//                 .compose(RxUtil.rxSchedulerHelper())
//                 .compose(RxUtil.handleResult())
//                 .subscribe(videoRes -> {
//                             VideoInfoPresenter.this.videoRes = videoRes;
//                             //标题
//                             getView().getSupportActionBar().setTitle(videoRes.title);
//                             //
//                             playVideo();
//                             //
//                             setIntro();
//                             //
//                             if (videoRes.list.size() > 1)
//                                 adapter.addAll(videoRes.list.get(1).childList);
//                             else
//                                 adapter.addAll(videoRes.list.get(0).childList);
//                         },
//                         throwable -> {
//                             JUtils.Toast("加载失败");
//                         },
//                         () -> {
//                             //加载完成...
//                         });
//     }
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//         rxSubscription.unsubscribe();
//     }
// }


// Path: app/src/main/java/com/zmj/qvod/view/activity/VideoInfoActivity.java
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.jude.beam.bijection.RequiresPresenter;
import com.jude.beam.expansion.BeamBaseActivity;
import com.jude.easyrecyclerview.EasyRecyclerView;
import com.zmj.qvod.R;
import com.zmj.qvod.module.bean.VideoInfo;
import com.zmj.qvod.presenter.VideoInfoPresenter;
import butterknife.BindView;
import butterknife.ButterKnife;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;

package com.zmj.qvod.view.activity;




/**
 * Created by matt on 2017/3/24.
 */
@RequiresPresenter(VideoInfoPresenter.class)
public class VideoInfoActivity extends BeamBaseActivity<VideoInfoPresenter> {

    @BindView(R.id.jc_video_play)
    JCVideoPlayerStandard jcVideoPlay;
    @BindView(R.id.ev_more)
    EasyRecyclerView evMore;


    private VideoInfo videoInfo;