use of cn.nicolite.palm300heroes.presenter.VideoPresenter in project Palm300Heroes by nicolite.
the class VideoFragment method doBusiness.
@Override
protected void doBusiness() {
lRecyclerView.setLayoutManager(new LinearLayoutManager(context, OrientationHelper.VERTICAL, false));
lRecyclerViewAdapter = new LRecyclerViewAdapter(new VideoAdapter(context, videoList));
lRecyclerView.setAdapter(lRecyclerViewAdapter);
videoPresenter = new VideoPresenter(this, this);
lRecyclerView.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
currentPage = 1;
videoPresenter.loadVideoList();
}
});
lRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore() {
videoPresenter.loadMore(++currentPage);
}
});
lRecyclerView.setOnNetWorkErrorListener(new OnNetWorkErrorListener() {
@Override
public void reload() {
videoPresenter.loadMore(currentPage);
}
});
lRecyclerViewAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Bilibili.DataBean.VlistBean vlistBean = videoList.get(position);
Bundle bundle = new Bundle();
bundle.putInt("type", WebViewActivity.TYPE_VIDEO);
bundle.putString("title", vlistBean.getTitle());
bundle.putString("url", "https://m.bilibili.com/video/av" + vlistBean.getAid() + ".html");
startActivity(WebViewActivity.class, bundle);
}
});
}
Aggregations