Search in sources :

Example 1 with BGANormalRefreshViewHolder

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

the class SwipeRecyclerViewActivity method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    mRefreshLayout.setRefreshViewHolder(new BGANormalRefreshViewHolder(mApp, true));
    initBanner();
    mDataRv.addItemDecoration(new Divider(this));
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
    linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    mDataRv.setLayoutManager(linearLayoutManager);
    mDataRv.setAdapter(mAdapter);
    mEngine.loadInitDatas().enqueue(new Callback<List<RefreshModel>>() {

        @Override
        public void onResponse(Call<List<RefreshModel>> call, Response<List<RefreshModel>> response) {
            mAdapter.setData(response.body());
        }

        @Override
        public void onFailure(Call<List<RefreshModel>> call, Throwable t) {
        }
    });
}
Also used : BGANormalRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGANormalRefreshViewHolder) List(java.util.List) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) Divider(cn.bingoogolapple.refreshlayout.demo.widget.Divider)

Example 2 with BGANormalRefreshViewHolder

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

the class RefreshStaggeredRecyclerViewFragment method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    mRefreshLayout.setCustomHeaderView(DataEngine.getCustomHeaderView(mApp), true);
    mRefreshLayout.setRefreshViewHolder(new BGANormalRefreshViewHolder(mApp, true));
    StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL);
    mDataRv.setLayoutManager(layoutManager);
    mDataRv.setAdapter(mAdapter);
}
Also used : BGANormalRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGANormalRefreshViewHolder) StaggeredGridLayoutManager(android.support.v7.widget.StaggeredGridLayoutManager)

Example 3 with BGANormalRefreshViewHolder

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

the class ViewPagerActivity method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    mRefreshLayout.setRefreshViewHolder(new BGANormalRefreshViewHolder(mApp, true));
    initBanner();
    mFragments = new Fragment[4];
    mFragments[0] = mRecyclerViewFragment = new StickyNavRecyclerViewFragment();
    mFragments[1] = mListViewFragment = new StickyNavListViewFragment();
    mFragments[2] = mScrollViewFragment = new StickyNavScrollViewFragment();
    mFragments[3] = mWebViewFragment = new StickyNavWebViewFragment();
    mTitles = new String[4];
    mTitles[0] = "RecyclerView";
    mTitles[1] = "ListView";
    mTitles[2] = "ScrollView";
    mTitles[3] = "WebView";
    mContentVp.setAdapter(new ContentViewPagerAdapter(getSupportFragmentManager()));
    mIndicator.initData(0, mContentVp);
}
Also used : StickyNavWebViewFragment(cn.bingoogolapple.refreshlayout.demo.ui.fragment.StickyNavWebViewFragment) BGANormalRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGANormalRefreshViewHolder) StickyNavRecyclerViewFragment(cn.bingoogolapple.refreshlayout.demo.ui.fragment.StickyNavRecyclerViewFragment) StickyNavListViewFragment(cn.bingoogolapple.refreshlayout.demo.ui.fragment.StickyNavListViewFragment) StickyNavScrollViewFragment(cn.bingoogolapple.refreshlayout.demo.ui.fragment.StickyNavScrollViewFragment)

Example 4 with BGANormalRefreshViewHolder

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

the class NormalListViewActivity method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    mRefreshLayout.setRefreshViewHolder(new BGANormalRefreshViewHolder(mApp, true));
    mDataLv.setAdapter(mAdapter);
    mEngine.loadInitDatas().enqueue(new Callback<List<RefreshModel>>() {

        @Override
        public void onResponse(Call<List<RefreshModel>> call, Response<List<RefreshModel>> response) {
            mAdapter.setData(response.body());
        }

        @Override
        public void onFailure(Call<List<RefreshModel>> call, Throwable t) {
        }
    });
}
Also used : BGANormalRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGANormalRefreshViewHolder) List(java.util.List)

Example 5 with BGANormalRefreshViewHolder

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

the class SwipeListViewActivity method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    mRefreshLayout.setRefreshViewHolder(new BGANormalRefreshViewHolder(mApp, true));
    mDataLv.setAdapter(mAdapter);
    mEngine.loadInitDatas().enqueue(new Callback<List<RefreshModel>>() {

        @Override
        public void onResponse(Call<List<RefreshModel>> call, Response<List<RefreshModel>> response) {
            mAdapter.setData(response.body());
        }

        @Override
        public void onFailure(Call<List<RefreshModel>> call, Throwable t) {
        }
    });
}
Also used : BGANormalRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGANormalRefreshViewHolder) List(java.util.List)

Aggregations

BGANormalRefreshViewHolder (cn.bingoogolapple.refreshlayout.BGANormalRefreshViewHolder)5 List (java.util.List)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)1 StickyNavListViewFragment (cn.bingoogolapple.refreshlayout.demo.ui.fragment.StickyNavListViewFragment)1 StickyNavRecyclerViewFragment (cn.bingoogolapple.refreshlayout.demo.ui.fragment.StickyNavRecyclerViewFragment)1 StickyNavScrollViewFragment (cn.bingoogolapple.refreshlayout.demo.ui.fragment.StickyNavScrollViewFragment)1 StickyNavWebViewFragment (cn.bingoogolapple.refreshlayout.demo.ui.fragment.StickyNavWebViewFragment)1 Divider (cn.bingoogolapple.refreshlayout.demo.widget.Divider)1