use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.
the class Mm99Fragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
unbinder = ButterKnife.bind(this, view);
swipeLayout.setOnRefreshListener(this);
AppUtils.setColorSchemeColors(context, swipeLayout);
recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
recyclerView.setAdapter(mm99Adapter);
mm99Adapter.setWidth(QMUIDisplayHelper.getScreenWidth(context) / 2);
mm99Adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
loadData(false, false);
}
});
mm99Adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Mm99 mm99 = (Mm99) adapter.getItem(position);
if (mm99 == null) {
return;
}
Intent intent = new Intent(context, PictureViewerActivity.class);
intent.putExtra(Keys.KEY_INTENT_99_MM_ITEM, mm99);
startActivityWithAnimotion(intent);
}
});
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.
the class BasePlayVideo method initVideoComments.
private void initVideoComments() {
List<VideoComment> videoCommentList = new ArrayList<>();
videoCommentAdapter = new VideoCommentAdapter(this, R.layout.item_video_comment, videoCommentList);
recyclerViewVideoComment.setLayoutManager(new LinearLayoutManager(this));
// recyclerViewVideoComment.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
recyclerViewVideoComment.setAdapter(videoCommentAdapter);
videoCommentAdapter.setLoadMoreView(new LoadMoreView() {
@Override
public int getLayoutId() {
return R.layout.loading;
}
@Override
protected int getLoadingViewId() {
return R.id.loading;
}
@Override
protected int getLoadFailViewId() {
return R.id.loadFailed;
}
@Override
protected int getLoadEndViewId() {
return R.id.loadEnd;
}
});
videoCommentAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
// 加载评论
if (unLimit91PornItem.getVideoResultId() == 0) {
videoCommentAdapter.loadMoreFail();
return;
}
presenter.loadVideoComment(unLimit91PornItem.getVideoResult().getVideoId(), unLimit91PornItem.getViewKey(), false);
}
}, recyclerViewVideoComment);
videoCommentAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
if (floatingToolbar.isShowing()) {
floatingToolbar.hide();
}
if (commentLayoutShown) {
if (videoCommentAdapter.getClickPosition() == position) {
hideCommentLayout();
}
} else {
showCommentLayout();
}
isComment = false;
videoComment = (VideoComment) adapter.getData().get(position);
etVideoComment.setHint("回复:" + videoComment.getuName());
videoCommentAdapter.setClickPosition(position);
}
});
recyclerViewVideoComment.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
if (dy > 0)
fab.hide();
else if (dy < -5)
fab.show();
}
});
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.
the class SearchActivity method init.
private void init() {
initToolBar(toolbar);
searchView.setQueryHint("搜索视频");
searchView.onActionViewExpanded();
List<String> datasetSortBy = new LinkedList<>(Arrays.asList(getResources().getStringArray(R.array.sort_by)));
niceSpinnerSortBy.attachDataSource(datasetSortBy);
List<String> datasetSearch = new LinkedList<>(Arrays.asList(getResources().getStringArray(R.array.search)));
niceSpinnerSearch.attachDataSource(datasetSearch);
List<UnLimit91PornItem> mUnLimit91PornItemList = new ArrayList<>();
mUnLimit91Adapter = new UnLimit91Adapter(R.layout.item_unlimit_91porn, mUnLimit91PornItemList);
mUnLimit91Adapter.openLoadAnimation();
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);
goToPlayVideo(unLimit91PornItems);
}
});
mUnLimit91Adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
presenter.searchVideos(searchId, sort, false);
}
}, recyclerView);
helper = new LoadViewHelper(recyclerView);
helper.setListener(new OnLoadViewListener() {
@Override
public void onRetryClick() {
presenter.searchVideos(searchId, sort, false);
}
});
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.
the class VideoListFragment method handlerSkipPage.
private void handlerSkipPage() {
if (dataManager.isOpenSkipPage()) {
skipPageLayout.setVisibility(View.VISIBLE);
skipPageRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
skipPageRecyclerView.setAdapter(skipPageAdapter);
skipPageAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
int page = (int) adapter.getItem(position);
loadData(false, false, page);
}
});
} else {
skipPageLayout.setVisibility(View.GONE);
}
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.
the class ForumFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
unbinder = ButterKnife.bind(this, view);
swipeLayout.setOnRefreshListener(this);
AppUtils.setColorSchemeColors(context, swipeLayout);
recyclerView.setLayoutManager(new LinearLayoutManager(context));
recyclerView.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
recyclerView.setAdapter(forun91PornAdapter);
forun91PornAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
loadData(false);
}
}, recyclerView);
if ("17".equals(category.getCategoryValue()) || "4".equals(category.getCategoryValue())) {
tipTextView.setVisibility(View.VISIBLE);
swipeLayout.setEnabled(false);
}
forun91PornAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Forum91PronItem forum91PronItem = (Forum91PronItem) adapter.getItem(position);
Intent intent = new Intent(context, Browse91PornActivity.class);
intent.putExtra(Keys.KEY_INTENT_BROWSE_FORUM_91_PORN_ITEM, forum91PronItem);
startActivityWithAnimotion(intent);
}
});
}
Aggregations