Search in sources :

Example 1 with GridAdapter

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

the class GridActivity 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 GridLayoutManager(this, 5));
    mAdapter = new GridAdapter(this);
    mRecyclerView.setAdapter(mAdapter);
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) GridAdapter(it.gmariotti.recyclerview.itemanimator.demo.adapter.GridAdapter)

Aggregations

GridLayoutManager (android.support.v7.widget.GridLayoutManager)1 GridAdapter (it.gmariotti.recyclerview.itemanimator.demo.adapter.GridAdapter)1