Search in sources :

Example 1 with SimpleDividerItemDecoration

use of org.andydyer.androidtestdemo.ui.widgets.SimpleDividerItemDecoration in project android-test-demo by abdyer.

the class EventListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_event_list, container, false);
    ButterKnife.inject(this, view);
    if (savedInstanceState == null) {
        adapter = new EventsAdapter();
    }
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new SimpleDividerItemDecoration(getActivity()));
    recyclerView.setAdapter(adapter);
    return view;
}
Also used : SimpleDividerItemDecoration(org.andydyer.androidtestdemo.ui.widgets.SimpleDividerItemDecoration) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) InjectView(butterknife.InjectView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Aggregations

DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 InjectView (butterknife.InjectView)1 SimpleDividerItemDecoration (org.andydyer.androidtestdemo.ui.widgets.SimpleDividerItemDecoration)1