Search in sources :

Example 1 with DividerItemDecoration

use of com.readystatesoftware.chuck.internal.support.DividerItemDecoration in project chuck by jgilfelt.

the class TransactionListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.chuck_fragment_transaction_list, container, false);
    if (view instanceof RecyclerView) {
        Context context = view.getContext();
        RecyclerView recyclerView = (RecyclerView) view;
        recyclerView.setLayoutManager(new LinearLayoutManager(context));
        recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL_LIST));
        adapter = new TransactionAdapter(getContext(), listener);
        recyclerView.setAdapter(adapter);
    }
    return view;
}
Also used : Context(android.content.Context) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.readystatesoftware.chuck.internal.support.DividerItemDecoration) SearchView(android.support.v7.widget.SearchView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Aggregations

Context (android.content.Context)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 SearchView (android.support.v7.widget.SearchView)1 View (android.view.View)1 DividerItemDecoration (com.readystatesoftware.chuck.internal.support.DividerItemDecoration)1