Search in sources :

Example 1 with AnimationGridAdapter

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

the class AnimationGridActivity 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 AnimationGridAdapter(this);
    AlphaAnimatorAdapter animatorAdapter = new AlphaAnimatorAdapter(mAdapter, mRecyclerView);
    animatorAdapter.getViewAnimator().setInitialDelayMillis(500);
    mRecyclerView.setAdapter(animatorAdapter);
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) AlphaAnimatorAdapter(it.gmariotti.recyclerview.adapter.AlphaAnimatorAdapter) AnimationGridAdapter(it.gmariotti.recyclerview.itemanimator.demo.adapter.AnimationGridAdapter)

Aggregations

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