Search in sources :

Example 1 with DividerItemDecoration

use of it.gmariotti.recyclerview.itemanimator.demo.adapter.DividerItemDecoration in project RecyclerViewItemAnimators by gabrielemariotti.

the class ListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recycler);
    //Setup Spinner
    setupSpinner();
    //Setup RecyclerView
    mRecyclerView = (RecyclerView) findViewById(R.id.list);
    //mRecyclerView.setHasFixedSize(true);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    mAdapter = new SimpleAdapter(this, sCheeseStrings);
    mRecyclerView.setAdapter(mAdapter);
}
Also used : SimpleAdapter(it.gmariotti.recyclerview.itemanimator.demo.adapter.SimpleAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(it.gmariotti.recyclerview.itemanimator.demo.adapter.DividerItemDecoration)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 DividerItemDecoration (it.gmariotti.recyclerview.itemanimator.demo.adapter.DividerItemDecoration)1 SimpleAdapter (it.gmariotti.recyclerview.itemanimator.demo.adapter.SimpleAdapter)1