use of com.github.jdsjlzx.interfaces.OnLoadMoreListener in project Palm300Heroes by nicolite.
the class HostRankFragment method doBusiness.
@Override
protected void doBusiness() {
lRecyclerView.setLayoutManager(new LinearLayoutManager(context, OrientationHelper.VERTICAL, false));
lRecyclerViewAdapter = new LRecyclerViewAdapter(new HostRankAdapter(context, dataList));
lRecyclerView.setAdapter(lRecyclerViewAdapter);
if (type == TYPE_RANK_TITLE) {
lRecyclerView.setLoadMoreEnabled(false);
}
hostRankPresenter = new HostRankPresenter(this, this);
lRecyclerView.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
switch(type) {
case TYPE_RANK_TITLE:
hostRankPresenter.showRankTitle();
break;
case TYPE_RANK_LIST:
hostRankPresenter.showRankList(index);
break;
}
}
});
lRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore() {
switch(type) {
case TYPE_RANK_TITLE:
break;
case TYPE_RANK_LIST:
currentPage++;
hostRankPresenter.loadMore(index, currentPage);
break;
}
}
});
lRecyclerViewAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
RecordRank.RankBean.ListBean list = dataList.get(position);
switch(type) {
case TYPE_RANK_TITLE:
Bundle bundle = new Bundle();
bundle.putInt("type", ContainerActivity.TYPE_RECORD_RANK_LIST);
bundle.putString("title", list.getName());
bundle.putString("extra", String.valueOf(list.getIndex()));
startActivity(ContainerActivity.class, bundle);
break;
case TYPE_RANK_LIST:
break;
}
}
});
if (isFirstVisible && ListUtils.isEmpty(dataList)) {
lRecyclerView.forceToRefresh();
}
}
use of com.github.jdsjlzx.interfaces.OnLoadMoreListener in project Palm300Heroes by nicolite.
the class MatchListFragment method doBusiness.
@Override
protected void doBusiness() {
lRecyclerView.setLayoutManager(new LinearLayoutManager(context, OrientationHelper.VERTICAL, false));
// lRecyclerViewAdapter = new LRecyclerViewAdapter();
lRecyclerView.setAdapter(lRecyclerViewAdapter);
lRecyclerView.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
}
});
lRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore() {
}
});
lRecyclerViewAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
}
});
}
use of com.github.jdsjlzx.interfaces.OnLoadMoreListener in project Palm300Heroes by nicolite.
the class NewsListFragment method doBusiness.
@Override
protected void doBusiness() {
lRecyclerView.setLayoutManager(new LinearLayoutManager(context, OrientationHelper.VERTICAL, false));
lRecyclerViewAdapter = new LRecyclerViewAdapter(new NewsAdapter(context, dataList));
lRecyclerView.setAdapter(lRecyclerViewAdapter);
newsListPresenter = new NewsListPresenter(this, this);
lRecyclerView.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
newsListPresenter.loadNewsList(url, type);
}
});
lRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore() {
currentPage++;
newsListPresenter.loadMoreNewsList(url, type, currentPage);
}
});
lRecyclerViewAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
News news = dataList.get(position);
if (!news.getNewsUrl().contains("/details/")) {
Bundle bundle = new Bundle();
bundle.putString("title", news.getNewsTitle());
bundle.putString("url", news.getNewsUrl());
bundle.putInt("type", WebViewActivity.TYPE_OTHERS);
startActivity(WebViewActivity.class, bundle);
} else {
Bundle bundle = new Bundle();
bundle.putString("url", news.getNewsUrl());
bundle.putString("title", news.getNewsTitle());
bundle.putInt("type", WebViewActivity.TYPE_NEWS);
startActivity(WebViewActivity.class, bundle);
}
}
});
if (url.equals(Constants.JUMP_NEWS_URL) && isFirstVisible && ListUtils.isEmpty(dataList)) {
lRecyclerView.forceToRefresh();
}
}
use of com.github.jdsjlzx.interfaces.OnLoadMoreListener 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);
}
});
}
use of com.github.jdsjlzx.interfaces.OnLoadMoreListener in project Palm300Heroes by nicolite.
the class HeroListFragment method doBusiness.
@Override
protected void doBusiness() {
heroListPresenter = new HeroListPresenter(this, this);
// 根据屏幕宽度计算一行能放多少个
int spanCount = (int) (ScreenUtils.getScreenWidth(context) / ScreenUtils.dp2px(context, 80));
// 防止每行个数为0
if (spanCount == 0) {
spanCount = 4;
}
lRecyclerView.setLayoutManager(new GridLayoutManager(context, spanCount, OrientationHelper.VERTICAL, false));
lRecyclerViewAdapter = new LRecyclerViewAdapter(new HeroAdapter(context, dataList));
lRecyclerView.setAdapter(lRecyclerViewAdapter);
lRecyclerView.setLoadMoreEnabled(false);
lRecyclerView.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
heroListPresenter.showHeroList(true);
}
});
lRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore() {
}
});
lRecyclerView.setOnNetWorkErrorListener(new OnNetWorkErrorListener() {
@Override
public void reload() {
}
});
lRecyclerViewAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Hero hero = dataList.get(position);
Bundle bundle = new Bundle();
bundle.putString("heroName", hero.getHeroName());
bundle.putString("heroType", hero.getHeroType());
bundle.putString("heroUNCode", hero.getUNCode());
bundle.putString("heroImage", hero.getPictureUrl());
bundle.putString("heroBackground", hero.getBackground());
bundle.putString("heroCoins", hero.getCoinsPrice());
bundle.putString("heroDiamond", hero.getDiamondPrice());
startActivity(HeroesDetailActivity.class, bundle);
}
});
if (isFirstVisible && ListUtils.isEmpty(dataList)) {
heroListPresenter.showHeroList(false);
}
}
Aggregations