Search in sources :

Example 1 with Title

use of com.gapcoder.weico.Title.Title in project weibo by dingdangmao123.

the class TitleAdapter method onCreateViewHolder.

@Override
public SnapViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(context).inflate(R.layout.titleitem, parent, false);
    final SnapViewHolder h = new SnapViewHolder(view);
    h.t1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            int p = h.getAdapterPosition();
            Intent i = new Intent(context, Title.class);
            i.putExtra("id", data.get(p).getId());
            i.putExtra("title", data.get(p).getTitle());
            context.startActivity(i);
        }
    });
    return h;
}
Also used : Title(com.gapcoder.weico.Title.Title) Intent(android.content.Intent) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 2 with Title

use of com.gapcoder.weico.Title.Title 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)2 Title (com.gapcoder.weico.Title.Title)2 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 SearchView (android.widget.SearchView)1 TextView (android.widget.TextView)1 TitleAdapter (com.gapcoder.weico.Index.Adapter.TitleAdapter)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