Search in sources :

Example 1 with BGAStickinessRefreshViewHolder

use of cn.bingoogolapple.refreshlayout.BGAStickinessRefreshViewHolder in project BGARefreshLayout-Android by bingoogolapple.

the class RefreshScrollViewFragment method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    BGAStickinessRefreshViewHolder stickinessRefreshViewHolder = new BGAStickinessRefreshViewHolder(mApp, true);
    stickinessRefreshViewHolder.setStickinessColor(R.color.colorPrimary);
    stickinessRefreshViewHolder.setRotateImage(R.mipmap.bga_refresh_stickiness);
    mRefreshLayout.setRefreshViewHolder(stickinessRefreshViewHolder);
    mRefreshLayout.setCustomHeaderView(DataEngine.getCustomHeaderView(mApp), false);
    mRefreshLayout.setPullDownRefreshEnable(false);
}
Also used : BGAStickinessRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGAStickinessRefreshViewHolder)

Example 2 with BGAStickinessRefreshViewHolder

use of cn.bingoogolapple.refreshlayout.BGAStickinessRefreshViewHolder in project BGARefreshLayout-Android by bingoogolapple.

the class RefreshNormalViewFragment method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    BGAStickinessRefreshViewHolder stickinessRefreshViewHolder = new BGAStickinessRefreshViewHolder(mApp, true);
    stickinessRefreshViewHolder.setStickinessColor(R.color.colorPrimary);
    stickinessRefreshViewHolder.setRotateImage(R.mipmap.bga_refresh_stickiness);
    mRefreshLayout.setRefreshViewHolder(stickinessRefreshViewHolder);
    mRefreshLayout.setCustomHeaderView(DataEngine.getCustomHeaderView(mApp), false);
}
Also used : BGAStickinessRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGAStickinessRefreshViewHolder)

Example 3 with BGAStickinessRefreshViewHolder

use of cn.bingoogolapple.refreshlayout.BGAStickinessRefreshViewHolder in project BGARefreshLayout-Android by bingoogolapple.

the class RefreshRecyclerViewFragment method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    //        mRefreshLayout.setCustomHeaderView(DataEngine.getCustomHeaderView(mApp), true);
    View headerView = View.inflate(mApp, R.layout.view_custom_header2, null);
    // 测试自定义header中控件的点击事件
    headerView.findViewById(R.id.btn_custom_header2_test).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            ToastUtil.show("点击了测试按钮");
        }
    });
    // 模拟网络数据加载,测试动态改变自定义header的高度
    new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            ((TextView) getViewById(R.id.tv_custom_header2_title)).setText(R.string.test_custom_header_title);
            ((TextView) getViewById(R.id.tv_custom_header2_desc)).setText(R.string.test_custom_header_desc);
        }
    }, 2000);
    //        mRefreshLayout.setCustomHeaderView(headerView, true);
    mAdapter.addHeaderView(headerView);
    BGAStickinessRefreshViewHolder stickinessRefreshViewHolder = new BGAStickinessRefreshViewHolder(mApp, true);
    stickinessRefreshViewHolder.setStickinessColor(R.color.colorPrimary);
    stickinessRefreshViewHolder.setRotateImage(R.mipmap.bga_refresh_stickiness);
    mRefreshLayout.setRefreshViewHolder(stickinessRefreshViewHolder);
    mDataRv.addItemDecoration(new Divider(mApp));
    mDataRv.setLayoutManager(new GridLayoutManager(mApp, 2, GridLayoutManager.VERTICAL, false));
    //        mDataRv.setLayoutManager(new LinearLayoutManager(mApp, LinearLayoutManager.VERTICAL, false));
    mDataRv.setAdapter(mAdapter.getHeaderAndFooterAdapter());
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) BGAStickinessRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGAStickinessRefreshViewHolder) Handler(android.os.Handler) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) Divider(cn.bingoogolapple.refreshlayout.demo.widget.Divider)

Aggregations

BGAStickinessRefreshViewHolder (cn.bingoogolapple.refreshlayout.BGAStickinessRefreshViewHolder)3 Handler (android.os.Handler)1 GridLayoutManager (android.support.v7.widget.GridLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 TextView (android.widget.TextView)1 Divider (cn.bingoogolapple.refreshlayout.demo.widget.Divider)1