本文整理汇总了Java中com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter类的典型用法代码示例。如果您正苦于以下问题:Java RecyclerArrayAdapter类的具体用法?Java RecyclerArrayAdapter怎么用?Java RecyclerArrayAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RecyclerArrayAdapter类属于com.jude.easyrecyclerview.adapter包,在下文中一共展示了RecyclerArrayAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initViews
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
@Override
protected void initViews() {
mTrendAdapter = new TrendAdapter(getActivity());
mTrendAdapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
TrendsRes.Trends trend = mTrendAdapter.getAllData().get(position);
Bundle bundle = new Bundle();
bundle.putString(TrendStatusesActivity.BUNDLE_SEARCH_KEYWORD, trend.getName());
Router.build(Constants.Router.TREND_STATUSES).extras(bundle).go(getActivity());
}
});
DividerDecoration itemDecoration =
new DividerDecoration(getResources().getColor(R.color.divider_line_color),
Math.round(getResources().getDimension(R.dimen.divider_line_size)), 0, 0);
itemDecoration.setDrawLastItem(true);
itemDecoration.setDrawHeaderFooter(false);
mRecyclerView.addItemDecoration(itemDecoration);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setAdapterWithProgress(mTrendAdapter);
mRecyclerView.setRefreshListener(this);
mRecyclerView.setRefreshingColor(getResources().getIntArray(R.array.refreshing_color));
}
示例2: initViews
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
@Override
protected void initViews() {
mStatusAdapter = new StatusAdapter(getActivity());
mStatusAdapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
StatusRes statusRes = mStatusAdapter.getItem(position);
Bundle bundle = new Bundle();
bundle.putParcelable(StatusDetailActivity.EXTRA_STATUS, statusRes);
Router.build(Constants.Router.STATUS_DETAIL).extras(bundle).go(getActivity());
}
});
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setAdapterWithProgress(mStatusAdapter);
mRecyclerView.setRefreshListener(this);
mRecyclerView.setRefreshingColor(getResources().getIntArray(R.array.refreshing_color));
}
示例3: init
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
@Override
protected void init() {
mLoadMoreView = new LoadMoreView(mActivity);
mJokeAdapter = new JokeAdapter(mActivity);
mRecyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
mRecyclerView.setAdapter(mJokeAdapter);
mRecyclerView.setRefreshListener(() -> {
mLoadMoreView.setLoading();
mPresenter.getData();
});
mJokeAdapter.setMore(mLoadMoreView, new RecyclerArrayAdapter.OnMoreListener() {
@Override
public void onMoreShow() {
mPresenter.getMoreData();
}
@Override
public void onMoreClick() {
}
});
mJokeAdapter.setNoMore(mLoadMoreView);
}
示例4: initView
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
private void initView() {
setRefreshingColor(
ContextCompat.getColor(getContext(), R.color.colorPrimary),
ContextCompat.getColor(getContext(), android.R.color.holo_blue_light),
ContextCompat.getColor(getContext(), android.R.color.holo_green_light)
);
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false);
setLayoutManager(layoutManager);
DividerDecoration dividerDecoration = new DividerDecoration(getResources().getColor(R.color.gray_e0), 20, 20, 0);
dividerDecoration.setDrawLastItem(true);
addItemDecoration(dividerDecoration);
mAdapter = new NewsListAdapter(getContext());
mAdapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
}
});
setAdapterWithProgress(mAdapter);
setRefreshListener(this);
new NewsListPresenter(this);
isActive = true;
}
示例5: configGuokrAdapter
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
/**
* 设置 RecyclerArrayAdapter 处理滑动到底部加载更多、点击图片跳转Activity等逻辑
*/
private void configGuokrAdapter(final RecyclerArrayAdapter<GuokrItem> adapter) {
mRecyclerView.setAdapterWithProgress(adapter);
adapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
// handle the item click events
Intent intent = new Intent(getActivity(), GuokrActivity.class);
intent.putExtra("article_image", adapter.getItem(position).headline_img);
intent.putExtra("article_title", adapter.getItem(position).title);
intent.putExtra("article_id", adapter.getItem(position).id); //传递当前点击item的文章id
intent.putExtra("article_summary", adapter.getItem(position).summary); //传递当前点击item的文章id
startActivity(intent);
}
});
}
示例6: doWithGirlAdapter
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
/**
* 设置 RecyclerArrayAdapter 处理滑动到底部加载更多、点击图片跳转Activity等逻辑
*/
private void doWithGirlAdapter(final RecyclerArrayAdapter<GirlItem> adapter) {
mRecyclerView.setAdapterWithProgress(adapter);
adapter.setMore(R.layout.recycler_load_more, this);
adapter.setNoMore(R.layout.recycler_no_more);
adapter.setError(R.layout.recycler_load_error);
adapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
Intent intent = new Intent(getActivity(), GirlActivity.class);
intent.putExtra("desc",adapter.getItem(position).desc);
intent.putExtra("url",adapter.getItem(position).url);
startActivity(intent);
}
});
}
示例7: configAdapter
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
/**
* 设置 RecyclerArrayAdapter 处理滑动到底部加载更多、点击图片跳转Activity等逻辑
*/
private void configAdapter(final RecyclerArrayAdapter<DailyStoryItem> adapter) {
mRecyclerView.setAdapterWithProgress(adapter);
adapter.setMore(R.layout.recycler_load_more, this);
adapter.setNoMore(R.layout.recycler_no_more);
adapter.setError(R.layout.recycler_load_error);
adapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
// handle the item click events
Intent intent = new Intent(getActivity(), ZhihuActivity.class);
intent.putExtra("story_id", adapter.getItem(position).id); //传递当前点击item的id
intent.putExtra("story_title", adapter.getItem(position).title);
intent.putExtra("story_image", adapter.getItem(position).images.get(0));
startActivity(intent);
}
});
}
示例8: configLatestAdapter
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
/**
* 设置 RecyclerArrayAdapter 处理滑动到底部加载更多、点击图片跳转Activity等逻辑
*/
private void configLatestAdapter(final RecyclerArrayAdapter<DoubanItem> adapter) {
mRecyclerView.setAdapterWithProgress(adapter);
adapter.setMore(R.layout.recycler_load_more, this);
adapter.setNoMore(R.layout.recycler_no_more);
adapter.setError(R.layout.recycler_load_error);
adapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
// handle the item click events
Intent intent = new Intent(getActivity(), DoubanActivity.class);
intent.putExtra("douban_id", adapter.getItem(position).id); //传递当前点击item的id
intent.putExtra("douban_title", adapter.getItem(position).title);
intent.putExtra("douban_image", adapter.getItem(position).image);
intent.putExtra("douban_short_url", adapter.getItem(position).short_url);
startActivity(intent);
}
});
}
示例9: onRefresh
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
@Override
public void onRefresh() {
BlogModel.getInstance().getSeedDetail(wid)
.doOnNext(seedDetail -> getAdapter().removeHeader(mHeader))
.map(seedDetail -> {
getAdapter().addHeader(mHeader = new RecyclerArrayAdapter.ItemView() {
@Override
public View onCreateView(ViewGroup viewGroup) {
return getView().getBlogDetailView(seedDetail, viewGroup);
}
@Override
public void onBindView(View view) {
}
});
JUtils.Log("onCreate" + seedDetail.getComments());
return seedDetail.getComments();
})
.finallyDo(()->getView().getListView().showRecycler())
.unsafeSubscribe(getRefreshSubscriber());
}
示例10: onRefresh
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
@Override
public void onRefresh() {
PlaceModel.getInstance().getEvaluateDetail(id)
.doOnNext(evaluateDetail -> getAdapter().removeHeader(mHeader))
.map(seedDetail -> {
getAdapter().addHeader(mHeader = new RecyclerArrayAdapter.ItemView() {
@Override
public View onCreateView(ViewGroup viewGroup) {
return getView().getEvaluateDetailView(seedDetail, viewGroup);
}
@Override
public void onBindView(View view) {
}
});
JUtils.Log("onRefresh" + (seedDetail.getComments()==null));
return seedDetail.getComments();
})
.doOnError(throwable -> JUtils.Log("Evaluate:" + throwable.getLocalizedMessage()))
.unsafeSubscribe(getRefreshSubscriber());
}
示例11: lazyInitView
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
@Override
public void lazyInitView(View view, Bundle savedInstanceState) {
final List<MineQuestionBean> data = new ArrayList<>();
for (int i = 0; i < 20; i++) {
final MineQuestionBean questionBean = new MineQuestionBean();
questionBean.setContent("使用NestedScrollView+ViewPager+RecyclerView+SmartRefreshLayout打造酷炫下拉视差效果并解决各种滑动冲突" + i);
data.add(questionBean);
}
recyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
recyclerView.addItemDecoration(new NormalDecoration(ContextCompat.getColor(mActivity, R.color.mainGrayF8), (int) mActivity.getResources().getDimension(R.dimen.eight)));
adapter = new MineQuestionAdapter(mActivity);
recyclerView.setAdapter(adapter);
adapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
Toast.makeText(mActivity, "---position---" + position, Toast.LENGTH_SHORT).show();
}
});
adapter.addAll(data);
adapter.setNoMore(R.layout.view_no_more);
adapter.setMore(R.layout.view_more, new RecyclerArrayAdapter.OnMoreListener() {
@Override
public void onMoreShow() {
Log.d(TAG, "----onMoreShow");
adapter.addAll(data);
}
@Override
public void onMoreClick() {
}
});
}
示例12: lazyInitView
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
@Override
public void lazyInitView(View view, Bundle savedInstanceState) {
final List<MineArticleBean> data = new ArrayList<>();
for (int i = 0; i < 20; i++) {
final MineArticleBean articleBean = new MineArticleBean();
articleBean.setContent("使用NestedScrollView+ViewPager+RecyclerView+SmartRefreshLayout打造酷炫下拉视差效果并解决各种滑动冲突" + i);
data.add(articleBean);
}
recyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
recyclerView.addItemDecoration(new NormalDecoration(ContextCompat.getColor(mActivity, R.color.mainGrayF8), (int) mActivity.getResources().getDimension(R.dimen.one)));
adapter = new MineArticleAdapter(mActivity);
recyclerView.setAdapter(adapter);
adapter.addAll(data);
adapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
Toast.makeText(mActivity, "---position---" + position, Toast.LENGTH_SHORT).show();
}
});
adapter.setNoMore(R.layout.view_no_more);
adapter.setMore(R.layout.view_more, new RecyclerArrayAdapter.OnMoreListener() {
@Override
public void onMoreShow() {
Log.d(TAG, "----onMoreShow");
adapter.addAll(data);
}
@Override
public void onMoreClick() {
}
});
}
示例13: setListView
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
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();
});
}
示例14: initViews
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
@Override
protected void initViews() {
mStatusAdapter = new StatusAdapter(getActivity());
mStatusAdapter.setMore(R.layout.view_load_more, new RecyclerArrayAdapter.OnMoreListener() {
@Override
public void onMoreShow() {
getFavorites(true);
}
@Override
public void onMoreClick() {
}
});
mStatusAdapter.setError(R.layout.view_load_more_error,
new RecyclerArrayAdapter.OnErrorListener() {
@Override
public void onErrorShow() {
}
@Override
public void onErrorClick() {
mStatusAdapter.resumeMore();
}
});
mStatusAdapter.setNoMore(R.layout.view_no_more);
mStatusAdapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
StatusRes statusRes = mStatusAdapter.getItem(position);
Bundle bundle = new Bundle();
bundle.putParcelable(StatusDetailActivity.EXTRA_STATUS, statusRes);
Router.build(Constants.Router.STATUS_DETAIL).extras(bundle).go(getActivity());
}
});
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setAdapterWithProgress(mStatusAdapter);
}
示例15: initViews
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; //导入依赖的package包/类
@Override
protected void initViews() {
mStatusAdapter = new StatusAdapter(getActivity());
mStatusAdapter.setMore(R.layout.view_load_more, new RecyclerArrayAdapter.OnMoreListener() {
@Override
public void onMoreShow() {
getUserTimeline(true);
}
@Override
public void onMoreClick() {
}
});
mStatusAdapter.setError(R.layout.view_load_more_error,
new RecyclerArrayAdapter.OnErrorListener() {
@Override
public void onErrorShow() {
}
@Override
public void onErrorClick() {
mStatusAdapter.resumeMore();
}
});
mStatusAdapter.setNoMore(R.layout.view_no_more);
mStatusAdapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
StatusRes statusRes = mStatusAdapter.getItem(position);
Bundle bundle = new Bundle();
bundle.putParcelable(StatusDetailActivity.EXTRA_STATUS, statusRes);
Router.build(Constants.Router.STATUS_DETAIL).extras(bundle).go(getActivity());
}
});
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setAdapterWithProgress(mStatusAdapter);
}