Java Code Examples for com.cjj.MaterialRefreshListener

The following examples show how to use com.cjj.MaterialRefreshListener. These examples are extracted from open source projects. 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 Project: MyHearts   Source File: AdvisoryFragment.java    License: 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 Project: MousePaint   Source File: RecommendActivity.java    License: 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 Project: MousePaint   Source File: HomeFragment.java    License: 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 Project: MousePaint   Source File: WeekActivity.java    License: 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();
        }
    });
}