本文整理汇总了Java中com.cjj.MaterialRefreshLayout类的典型用法代码示例。如果您正苦于以下问题:Java MaterialRefreshLayout类的具体用法?Java MaterialRefreshLayout怎么用?Java MaterialRefreshLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MaterialRefreshLayout类属于com.cjj包,在下文中一共展示了MaterialRefreshLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initRefresh
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
private void initRefresh(MaterialRefreshLayout materialRefreshLayout) {
page = 1; //重置 在刷新的时候
OkGo.post(HttpUrlPaths.LORD_DETAIL_URL)
.params("catgId", catgId)
.params("page", page)
.params("userid", 0)
.getCall(StringConvert.create(), RxAdapter.<String>create())
.doOnSubscribe(() -> {
})
.observeOn(AndroidSchedulers.mainThread())
.subscribe(s -> {
Type type = new TypeToken<LordDetailBean>() {
}.getType();
LordDetailBean bean = new Gson().fromJson(s, type);
if (bean.getErrorStr().equals("success")
&& bean.getErrorCode() == 0
&& bean.getResultCount() > 0) {
mLordDetailDatas.clear();
detailAdapter.notifyDataSetChanged();
mLordRefresh.finishRefresh();
}
}, throwable -> {
});
}
示例2: initView
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
/**
* 初始化View
*
* @param view
*/
private void initView(View view) {
mActionSearchView = (ImageButton) view.findViewById(R.id.action_search_view);
mSortAllTxt = (TextView) view.findViewById(R.id.sort_all_txt);
mSortAllLayout = (LinearLayout) view.findViewById(R.id.sort_all_layout);
mSortConsultantCntTxt = (TextView) view.findViewById(R.id.sort_consultant_cnt_txt);
mSortConsultantCntLayout = (LinearLayout) view.findViewById(R.id.sort_consultant_cnt_layout);
mSortPriceTxt = (TextView) view.findViewById(R.id.sort_price_txt);
mSortPriceIcon = (ImageView) view.findViewById(R.id.sort_price_icon);
mSortAllTxt = (TextView) view.findViewById(R.id.sort_all_txt);
mSortPriceLayout = (RelativeLayout) view.findViewById(R.id.sort_price_layout);
mSortContinuedPercentTxt = (TextView) view.findViewById(R.id.sort_continued_percent_txt);
mSortContinuedPercentLayout = (LinearLayout) view.findViewById(R.id.sort_continued_percent_layout);
mFlyBanner = (FlyBanner) view.findViewById(R.id.fly_banner);
mSortCommentRatingLayout = (LinearLayout) view.findViewById(R.id.sort_comment_rating_layout);
mSortHeaderLayout = (LinearLayout) view.findViewById(R.id.sort_header_layout);
mDataList = (RecyclerView) view.findViewById(R.id.data_list);
mRefreshLayout = (MaterialRefreshLayout) view.findViewById(R.id.refresh_layout);
}
示例3: handRefreshMore
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
private void handRefreshMore(MaterialRefreshLayout materialRefreshLayout) {
switch (mViewPager_book.getCurrentItem())
{
case 0:
EventBus.getDefault().post(new RefreshEvent(materialRefreshLayout,"refresh_hot"));
break;
case 1:
EventBus.getDefault().post(new RefreshEvent(materialRefreshLayout,"refresh_same"));
break;
case 2:
EventBus.getDefault().post(new RefreshEvent(materialRefreshLayout,"refresh_mouse"));
break;
case 3:
break;
}
}
示例4: onRefreshLoadMore
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
@Override
public void onRefreshLoadMore(final MaterialRefreshLayout materialRefreshLayout) {
LogUtils.i("load more: start=" + start);
String arcIds = parseIds();
if (!TextUtils.isEmpty(arcIds)) {
requestNews(arcIds, false, true);
} else {
ToastUtils.showToast("已经到底啦");
complete();
}
}
示例5: initRefresh
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
private void initRefresh(MaterialRefreshLayout materialRefreshLayout) {
page = 1;
OkGo.post(HttpUrlPaths.SCAN_MORE)
.params("userid", "54442")
.params("page", page + "")
.getCall(StringConvert.create(), RxAdapter.<String>create())
.doOnSubscribe(() -> {
})
.observeOn(AndroidSchedulers.mainThread())
.subscribe(s -> {
Type type = new TypeToken<HomeNewsBean>() {
}.getType();
HomeNewsBean bean = new Gson().fromJson(s, type);
if (bean.getErrorCode() == 0
&& bean.getErrorStr().equals("success")
&& bean.getResults().size() > 0) {
mOrationDatas.clear();
mOrationDatas = bean.getResults();
mOrationAdapter.addData(mOrationDatas);
materialRefreshLayout.finishRefresh();
}
}, throwable -> {
});
}
示例6: initListener
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
private void initListener() {
mDataList.setLayoutManager(new LinearLayoutManager(getContext()){
@Override
public boolean canScrollVertically() {
return false;
}
});
mDataList.setItemAnimator(new SlideInOutTopItemAnimator(mDataList));
mDataList.addItemDecoration(new DividerItemDecoration(getContext(),
DividerItemDecoration.VERTICAL_LIST));
mAdvisoryAdapter = new AdvisoryAdapter(getContext(), mDatas);
mAdvisoryAdapter.setOnItemClickListener((view, position) -> {
int index = mDatas.size()-position-1; //不太明白,为什么显示的是倒叙
AdvisoryFragmentBean.ResultsBean resultsBean = mDatas.get(index);
String userid = resultsBean.getUserid();
Intent intent = new Intent(getActivity(), UserDetailActivity.class);
intent.putExtra(Contants.USER_ID, userid);
intent.putExtra(Contants.C_USER_ID, userid);
startActivity(intent);
});
mDataList.setAdapter(mAdvisoryAdapter);
mRefreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
@Override
public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
refreshData();
}
});
}
示例7: initView
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
/**
* 初始化布局控件
*/
private void initView() {
mRefreshLayout = (MaterialRefreshLayout) findViewById(R.id.refresh);
mRecyclerView = (RecyclerView) findViewById(R.id.recycleview);
initRefresh();
}
示例8: Data
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
private void Data() {
viewSelectorLayout.show_LoadingView();
getRecommendBookData();
refreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
@Override
public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
getRecommendBookData();
}
});
}
示例9: onActivityCreated
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
viewSelectorLayout.show_LoadingView();
getBookData();
refreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
@Override
public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
getBookData();
}
});
}
示例10: Data
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
private void Data() {
viewSelectorLayout.show_LoadingView();
getWeekBookData();
refreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
@Override
public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
getWeekBookData();
}
});
}
示例11: setRefreshLayout
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
public Builder setRefreshLayout(MaterialRefreshLayout refreshLayout) {
this.mRefreshLayout = refreshLayout;
return builder;
}
示例12: setRefreshLayout
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
public Builder setRefreshLayout(MaterialRefreshLayout refreshLayout){
this.mRefreshLayout = refreshLayout;
return builder;
}
示例13: onRefresh
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
@Override
public void onRefresh(final MaterialRefreshLayout materialRefreshLayout) {
requestIndex(true);
}
示例14: onRefresh
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
@Override
public void onRefresh(final MaterialRefreshLayout materialRefreshLayout) {
presenter.requestTeamsRank(true);
}
示例15: onRefresh
import com.cjj.MaterialRefreshLayout; //导入依赖的package包/类
@Override
public void onRefresh(final MaterialRefreshLayout materialRefreshLayout) {
requestMatchs(date, true);
}