Search in sources :

Example 11 with OnLoadmoreListener

use of com.scwang.smartrefresh.layout.listener.OnLoadmoreListener in project weibo by dingdangmao123.

the class TitleFG method CreateView.

@Override
public void CreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, View v) {
    adapter = new TitleAdapter(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();
        }
    });
    search.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextSubmit(String s) {
            Intent i = new Intent(getActivity(), Title.class);
            i.putExtra("title", s);
            getActivity().startActivity(i);
            return false;
        }

        @Override
        public boolean onQueryTextChange(String s) {
            return false;
        }
    });
}
Also used : SearchView(android.widget.SearchView) SmartRefreshLayout(com.scwang.smartrefresh.layout.SmartRefreshLayout) RefreshLayout(com.scwang.smartrefresh.layout.api.RefreshLayout) Title(com.gapcoder.weico.Title.Title) Intent(android.content.Intent) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) OnLoadmoreListener(com.scwang.smartrefresh.layout.listener.OnLoadmoreListener) TitleAdapter(com.gapcoder.weico.Index.Adapter.TitleAdapter) OnRefreshListener(com.scwang.smartrefresh.layout.listener.OnRefreshListener)

Example 12 with OnLoadmoreListener

use of com.scwang.smartrefresh.layout.listener.OnLoadmoreListener in project weibo by dingdangmao123.

the class AtFG method CreateView.

@Override
public void CreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, View v) {
    adapter = new AtAdapter(data, getActivity());
    tl.setLayoutManager(new LinearLayoutManager(getActivity(), 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);
        }
    });
}
Also used : AtAdapter(com.gapcoder.weico.Message.Adapter.AtAdapter) 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 13 with OnLoadmoreListener

use of com.scwang.smartrefresh.layout.listener.OnLoadmoreListener in project weibo by dingdangmao123.

the class CommFG method CreateView.

@Override
public void CreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, View v) {
    adapter = new CommAdapter(data, getActivity());
    tl.setLayoutManager(new LinearLayoutManager(getActivity(), 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);
        }
    });
}
Also used : SmartRefreshLayout(com.scwang.smartrefresh.layout.SmartRefreshLayout) RefreshLayout(com.scwang.smartrefresh.layout.api.RefreshLayout) CommAdapter(com.gapcoder.weico.Message.Adapter.CommAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) OnLoadmoreListener(com.scwang.smartrefresh.layout.listener.OnLoadmoreListener) OnRefreshListener(com.scwang.smartrefresh.layout.listener.OnRefreshListener)

Example 14 with OnLoadmoreListener

use of com.scwang.smartrefresh.layout.listener.OnLoadmoreListener 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 15 with OnLoadmoreListener

use of com.scwang.smartrefresh.layout.listener.OnLoadmoreListener 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)

Aggregations

RefreshLayout (com.scwang.smartrefresh.layout.api.RefreshLayout)17 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)14 SmartRefreshLayout (com.scwang.smartrefresh.layout.SmartRefreshLayout)13 OnLoadmoreListener (com.scwang.smartrefresh.layout.listener.OnLoadmoreListener)12 OnRefreshListener (com.scwang.smartrefresh.layout.listener.OnRefreshListener)12 RecyclerView (android.support.v7.widget.RecyclerView)6 View (android.view.View)6 Toolbar (android.support.v7.widget.Toolbar)5 OnLoadMoreListener (com.scwang.smartrefresh.layout.listener.OnLoadMoreListener)5 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)4 AdapterView (android.widget.AdapterView)4 BaseRecyclerAdapter (com.scwang.refreshlayout.adapter.BaseRecyclerAdapter)4 SmartViewHolder (com.scwang.refreshlayout.adapter.SmartViewHolder)4 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)3 WeicoAdapter (com.gapcoder.weico.Index.Adapter.WeicoAdapter)3 Intent (android.content.Intent)2 BottomSheetDialog (android.support.design.widget.BottomSheetDialog)2 ViewGroup (android.view.ViewGroup)2 AbsListView (android.widget.AbsListView)2 ImageView (android.widget.ImageView)2