com.cjj.MaterialRefreshListener Java Examples

The following examples show how to use com.cjj.MaterialRefreshListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AdvisoryFragment.java    From MyHearts with Apache License 2.0 5 votes vote down vote up
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();
        }
    });
}
 
Example #2
Source File: RecommendActivity.java    From MousePaint with MIT License 5 votes vote down vote up
private void Data() {
    viewSelectorLayout.show_LoadingView();
    getRecommendBookData();

    refreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
        @Override
        public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
            getRecommendBookData();
        }
    });
}
 
Example #3
Source File: HomeFragment.java    From MousePaint with MIT License 5 votes vote down vote up
@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();
        }
    });
}
 
Example #4
Source File: WeekActivity.java    From MousePaint with MIT License 5 votes vote down vote up
private void Data() {
    viewSelectorLayout.show_LoadingView();
    getWeekBookData();

    refreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
        @Override
        public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
            getWeekBookData();
        }
    });
}