Search in sources :

Example 1 with TitleAdapter

use of com.gapcoder.weico.Index.Adapter.TitleAdapter 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)

Aggregations

Intent (android.content.Intent)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 SearchView (android.widget.SearchView)1 TitleAdapter (com.gapcoder.weico.Index.Adapter.TitleAdapter)1 Title (com.gapcoder.weico.Title.Title)1 SmartRefreshLayout (com.scwang.smartrefresh.layout.SmartRefreshLayout)1 RefreshLayout (com.scwang.smartrefresh.layout.api.RefreshLayout)1 OnLoadmoreListener (com.scwang.smartrefresh.layout.listener.OnLoadmoreListener)1 OnRefreshListener (com.scwang.smartrefresh.layout.listener.OnRefreshListener)1