use of com.helper.loadviewhelper.load.LoadViewHelper in project 91Pop by DanteAndroid.
the class AuthorActivity method init.
private void init() {
swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
presenter.authorVideos(uid, true);
}
});
swipeLayout.setEnabled(false);
List<UnLimit91PornItem> mUnLimit91PornItemList = new ArrayList<>();
mUnLimit91Adapter = new UnLimit91Adapter(R.layout.item_unlimit_91porn, mUnLimit91PornItemList);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(mUnLimit91Adapter);
mUnLimit91Adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
UnLimit91PornItem unLimit91PornItems = (UnLimit91PornItem) adapter.getData().get(position);
Intent intent = new Intent();
intent.putExtra(Keys.KEY_INTENT_UNLIMIT91PORNITEM, unLimit91PornItems);
setResult(AUTHORACTIVITY_RESULT_CODE, intent);
onBackPressed();
}
});
mUnLimit91Adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
presenter.authorVideos(uid, false);
}
}, recyclerView);
helper = new LoadViewHelper(recyclerView);
helper.setListener(new OnLoadViewListener() {
@Override
public void onRetryClick() {
swipeLayout.setEnabled(false);
presenter.authorVideos(uid, true);
}
});
presenter.authorVideos(uid, false);
}
use of com.helper.loadviewhelper.load.LoadViewHelper in project 91Pop by DanteAndroid.
the class IndexFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
unbinder = ButterKnife.bind(this, view);
// Setup contentView == SwipeRefreshView
contentView.setOnRefreshListener(this);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(mUnLimit91Adapter);
mUnLimit91Adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
UnLimit91PornItem unLimit91PornItems = mUnLimit91PornItemList.get(position);
goToPlayVideo(unLimit91PornItems);
}
});
helper = new LoadViewHelper(recyclerView);
helper.setListener(new OnLoadViewListener() {
@Override
public void onRetryClick() {
loadData(false, true);
}
});
AppUtils.setColorSchemeColors(context, contentView);
}
Aggregations