Search in sources :

Example 36 with RefreshLayout

use of com.scwang.smartrefresh.layout.api.RefreshLayout in project weibo by dingdangmao123.

the class FollowFG method CreateView.

@Override
public void CreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, View v) {
    adapter = new UserListAdapter(data, getActivity());
    tl.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
    tl.setAdapter(adapter);
    rf.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh(RefreshLayout refreshlayout) {
            Refresh();
        }
    });
    rf.setOnLoadmoreListener(new OnLoadmoreListener() {

        @Override
        public void onLoadmore(RefreshLayout refreshlayout) {
            rf.finishLoadmore();
        }
    });
}
Also used : SmartRefreshLayout(com.scwang.smartrefresh.layout.SmartRefreshLayout) RefreshLayout(com.scwang.smartrefresh.layout.api.RefreshLayout) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) OnLoadmoreListener(com.scwang.smartrefresh.layout.listener.OnLoadmoreListener) UserListAdapter(com.gapcoder.weico.UserList.UserListAdapter) OnRefreshListener(com.scwang.smartrefresh.layout.listener.OnRefreshListener)

Example 37 with RefreshLayout

use of com.scwang.smartrefresh.layout.api.RefreshLayout in project weibo by dingdangmao123.

the class Title method init.

@Override
public void init() {
    title = new TitleModel.inner(getIntent().getIntExtra("id", 0), getIntent().getStringExtra("title"));
    getSupportActionBar().setTitle(title.getTitle());
    adapter = new WeicoAdapter(data, this);
    tl.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    tl.setAdapter(adapter);
    rf.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh(RefreshLayout refreshlayout) {
            Refresh(1);
        }
    });
    rf.setOnLoadmoreListener(new OnLoadmoreListener() {

        @Override
        public void onLoadmore(RefreshLayout refreshlayout) {
            Refresh(0);
        }
    });
    rf.autoRefresh();
    Refresh(1);
}
Also used : SmartRefreshLayout(com.scwang.smartrefresh.layout.SmartRefreshLayout) RefreshLayout(com.scwang.smartrefresh.layout.api.RefreshLayout) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) OnLoadmoreListener(com.scwang.smartrefresh.layout.listener.OnLoadmoreListener) OnRefreshListener(com.scwang.smartrefresh.layout.listener.OnRefreshListener) TitleModel(com.gapcoder.weico.Index.Model.TitleModel) WeicoAdapter(com.gapcoder.weico.Index.Adapter.WeicoAdapter)

Example 38 with RefreshLayout

use of com.scwang.smartrefresh.layout.api.RefreshLayout in project weibo by dingdangmao123.

the class Account method init.

@Override
public void init() {
    if ((uid = getIntent().getIntExtra("uid", 0)) == 0)
        return;
    adapter = new WeicoAdapter(data, this);
    tl.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    tl.setAdapter(adapter);
    tl.setNestedScrollingEnabled(false);
    rf.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh(RefreshLayout refreshlayout) {
            Refresh(1);
        }
    });
    rf.setOnLoadmoreListener(new OnLoadmoreListener() {

        @Override
        public void onLoadmore(RefreshLayout refreshlayout) {
            Refresh(0);
        }
    });
    getUser();
    rf.autoRefresh();
}
Also used : SmartRefreshLayout(com.scwang.smartrefresh.layout.SmartRefreshLayout) RefreshLayout(com.scwang.smartrefresh.layout.api.RefreshLayout) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) OnLoadmoreListener(com.scwang.smartrefresh.layout.listener.OnLoadmoreListener) OnRefreshListener(com.scwang.smartrefresh.layout.listener.OnRefreshListener) WeicoAdapter(com.gapcoder.weico.Index.Adapter.WeicoAdapter)

Example 39 with RefreshLayout

use of com.scwang.smartrefresh.layout.api.RefreshLayout in project weibo by dingdangmao123.

the class Comment method init.

@Override
public void init() {
    if ((wid = getIntent().getIntExtra("wid", 0)) == 0) {
        T.show(this, "参数错误");
        return;
    }
    adapter = new CommentAdapter(data, this);
    tl.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    tl.setAdapter(adapter);
    tl.setNestedScrollingEnabled(false);
    rf.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh(RefreshLayout refreshlayout) {
            getWeico();
            Refresh(1);
        }
    });
    rf.setOnLoadmoreListener(new OnLoadmoreListener() {

        @Override
        public void onLoadmore(RefreshLayout refreshlayout) {
            Refresh(0);
        }
    });
    getWeico();
    Refresh(1);
}
Also used : SmartRefreshLayout(com.scwang.smartrefresh.layout.SmartRefreshLayout) RefreshLayout(com.scwang.smartrefresh.layout.api.RefreshLayout) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) OnLoadmoreListener(com.scwang.smartrefresh.layout.listener.OnLoadmoreListener) OnRefreshListener(com.scwang.smartrefresh.layout.listener.OnRefreshListener)

Example 40 with RefreshLayout

use of com.scwang.smartrefresh.layout.api.RefreshLayout in project MVP by yuchengren.

the class BaseApplication method initRefreshView.

private void initRefreshView() {
    SmartRefreshLayout.setDefaultRefreshHeaderCreator(new DefaultRefreshHeaderCreator() {

        @NonNull
        @Override
        public RefreshHeader createRefreshHeader(@NonNull Context context, @NonNull RefreshLayout layout) {
            return new MKRefreshHeader(context);
        }
    });
    SmartRefreshLayout.setDefaultRefreshFooterCreator(new DefaultRefreshFooterCreator() {

        @NonNull
        @Override
        public RefreshFooter createRefreshFooter(@NonNull Context context, @NonNull RefreshLayout layout) {
            ClassicsFooter classicsFooter = new ClassicsFooter(context);
            ClassicsFooter.REFRESH_FOOTER_NOTHING = "没有更多数据啦";
            classicsFooter.setTextSizeTitle(14);
            classicsFooter.setAccentColorId(R.color.text_color_medium);
            return classicsFooter;
        }
    });
}
Also used : Context(android.content.Context) MKRefreshHeader(com.ycr.module.base.view.pullrefresh.MKRefreshHeader) RefreshHeader(com.scwang.smartrefresh.layout.api.RefreshHeader) RefreshFooter(com.scwang.smartrefresh.layout.api.RefreshFooter) DefaultRefreshFooterCreator(com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator) DefaultRefreshHeaderCreator(com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator) SmartRefreshLayout(com.scwang.smartrefresh.layout.SmartRefreshLayout) RefreshLayout(com.scwang.smartrefresh.layout.api.RefreshLayout) NonNull(android.support.annotation.NonNull) MKRefreshHeader(com.ycr.module.base.view.pullrefresh.MKRefreshHeader) ClassicsFooter(com.ycr.lib.ui.pullrefresh.smart.footer.ClassicsFooter)

Aggregations

RefreshLayout (com.scwang.smartrefresh.layout.api.RefreshLayout)40 View (android.view.View)26 Toolbar (android.support.v7.widget.Toolbar)24 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)22 OnRefreshListener (com.scwang.smartrefresh.layout.listener.OnRefreshListener)20 SmartRefreshLayout (com.scwang.smartrefresh.layout.SmartRefreshLayout)17 RecyclerView (android.support.v7.widget.RecyclerView)15 OnLoadmoreListener (com.scwang.smartrefresh.layout.listener.OnLoadmoreListener)12 SmartViewHolder (com.scwang.refreshlayout.adapter.SmartViewHolder)11 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)10 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)10 AdapterView (android.widget.AdapterView)10 SimpleMultiPurposeListener (com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener)9 BaseRecyclerAdapter (com.scwang.refreshlayout.adapter.BaseRecyclerAdapter)7 RefreshHeader (com.scwang.smartrefresh.layout.api.RefreshHeader)7 TextView (android.widget.TextView)6 ImageView (android.widget.ImageView)5 RefreshState (com.scwang.smartrefresh.layout.constant.RefreshState)5 ClassicsHeader (com.scwang.smartrefresh.layout.header.ClassicsHeader)5 OnLoadMoreListener (com.scwang.smartrefresh.layout.listener.OnLoadMoreListener)5