当前位置: 首页>>代码示例>>Java>>正文


Java RecyclerAdapterWithHF类代码示例

本文整理汇总了Java中com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF的典型用法代码示例。如果您正苦于以下问题:Java RecyclerAdapterWithHF类的具体用法?Java RecyclerAdapterWithHF怎么用?Java RecyclerAdapterWithHF使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RecyclerAdapterWithHF类属于com.chanven.lib.cptr.recyclerview包,在下文中一共展示了RecyclerAdapterWithHF类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setListener

import com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF; //导入依赖的package包/类
@Override
protected void setListener() {
    mAdapterWithHf.setOnItemClickListener(new RecyclerAdapterWithHF.OnItemClickListener() {
        @Override
        public void onItemClick(RecyclerAdapterWithHF adapter, RecyclerView.ViewHolder vh, int position) {
            StatusDetailActivity.start(getActivity(), (StatusModel) mDao.getList().get(position));
        }
    });
}
 
开发者ID:aollio,项目名称:weixzz-app,代码行数:10,代码来源:HomeTimelineFragment.java

示例2: setListener

import com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF; //导入依赖的package包/类
@Override
protected void setListener() {
    mAdapterWithHf.setOnItemClickListener(new RecyclerAdapterWithHF.OnItemClickListener() {
        @Override
        public void onItemClick(RecyclerAdapterWithHF adapter, RecyclerView.ViewHolder vh, int position) {
            StatusDetailActivity.start(getActivity(), ((CommentModel) mDao.getList().get(position)).status);
        }
    });
}
 
开发者ID:aollio,项目名称:weixzz-app,代码行数:10,代码来源:CommentTimelineFragment.java

示例3: setListener

import com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF; //导入依赖的package包/类
@Override
protected void setListener() {
    mAdapterWithHf.setOnItemClickListener(new RecyclerAdapterWithHF.OnItemClickListener() {
        @Override
        public void onItemClick(RecyclerAdapterWithHF adapter, RecyclerView.ViewHolder vh, int position) {
            StatusDetailActivity.start(getActivity(), ((StatusModel) mDao.getList().get(position)).retweeted_status);
        }
    });
}
 
开发者ID:aollio,项目名称:weixzz-app,代码行数:10,代码来源:MentionsTimelineFragment.java

示例4: onCreateView

import com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.abs_timeline_status_recycler, container, false);
    mView = view;
    //获取recyclerView
    mRecyclerView = (RecyclerView) view.findViewById(R.id.abs_timeline_fragment_content_recyclerView);
    //
    mPtrClassicFrameLayout = (PtrClassicFrameLayout) view.findViewById(R.id.abs_timeline_fragment_content_ptrFrame);
    mPtrClassicFrameLayout.setClickable(true);
    mDao = bindDao();
    //cache读取数据
    mDao.loadFromCache();

    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerView.addItemDecoration(new RecyclerViewDivider(getActivity(), LinearLayoutManager.HORIZONTAL));

    mAdapter = bindAdapter();
    mAdapterWithHf = new RecyclerAdapterWithHF(mAdapter);
    mRecyclerView.setAdapter(mAdapterWithHf);
    setListener();
    //第一次执行刷新
    mPtrClassicFrameLayout.postDelayed(new Runnable() {
        @Override
        public void run() {
            mPtrClassicFrameLayout.autoRefresh(true);
        }
    }, 150);
    mPtrClassicFrameLayout.setPtrHandler(new PtrDefaultHandler() {
        @Override
        public void onRefreshBegin(PtrFrameLayout frame) {
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    new Refresher(mView).execute(true);
                    mPtrClassicFrameLayout.setLoadMoreEnable(true);
                    mAdapterWithHf.notifyDataSetChanged();
                    mPtrClassicFrameLayout.refreshComplete();
                }
            }, 1500);
        }
    });

    mPtrClassicFrameLayout.setOnLoadMoreListener(new OnLoadMoreListener() {

        @Override
        public void loadMore() {
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    new Refresher(mView).execute(false);
                    mPtrClassicFrameLayout.loadMoreComplete(true);
                    mAdapterWithHf.notifyDataSetChanged();
                }
            }, 1000);
        }
    });

    return view;
}
 
开发者ID:aollio,项目名称:weixzz-app,代码行数:61,代码来源:BaseHomeTimelineFragment.java

示例5: init

import com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF; //导入依赖的package包/类
private void init() {
    adapter = new RecyclerAdapter(this, mData);
    mAdapter = new RecyclerAdapterWithHF(adapter);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.setAdapter(mAdapter);
    ptrClassicFrameLayout.postDelayed(new Runnable() {

        @Override
        public void run() {
            ptrClassicFrameLayout.autoRefresh(true);
        }
    }, 150);

    ptrClassicFrameLayout.setPtrHandler(new PtrDefaultHandler() {

        @Override
        public void onRefreshBegin(PtrFrameLayout frame) {
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    page = 0;
                    mData.clear();
                    for (int i = 0; i < 17; i++) {
                        mData.add(new String("  RecyclerView item  -" + i));
                    }
                    mAdapter.notifyDataSetChanged();
                    ptrClassicFrameLayout.refreshComplete();
                    ptrClassicFrameLayout.setLoadMoreEnable(true);
                }
            }, 1500);
        }
    });

    ptrClassicFrameLayout.setOnLoadMoreListener(new OnLoadMoreListener() {

        @Override
        public void loadMore() {
            handler.postDelayed(new Runnable() {

                @Override
                public void run() {
                    mData.add(new String("  RecyclerView item  - add " + page));
                    mAdapter.notifyDataSetChanged();
                    ptrClassicFrameLayout.loadMoreComplete(true);
                    page++;
                    Toast.makeText(RecyclerViewActivity.this, "load more complete", Toast.LENGTH_SHORT).show();
                }
            }, 1000);
        }
    });
}
 
开发者ID:2402091500,项目名称:CommonPullToRefresh-master,代码行数:52,代码来源:RecyclerViewActivity.java


注:本文中的com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。