Search in sources :

Example 6 with CardArrayRecyclerViewAdapter

use of it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter in project cardslib by gabrielemariotti.

the class RecyclerViewFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    hideList(false);
    //Set the arrayAdapter
    ArrayList<Card> cards = new ArrayList<Card>();
    mCardArrayAdapter = new CardArrayRecyclerViewAdapter(getActivity(), cards);
    //Staggered grid view
    CardRecyclerView mRecyclerView = (CardRecyclerView) getActivity().findViewById(R.id.carddemo_recyclerview);
    mRecyclerView.setHasFixedSize(false);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    //Set the empty view
    if (mRecyclerView != null) {
        mRecyclerView.setAdapter(mCardArrayAdapter);
    }
    //Load cards
    new LoaderAsyncTask().execute();
}
Also used : CardRecyclerView(it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView) ArrayList(java.util.ArrayList) CardArrayRecyclerViewAdapter(it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) BaseCard(it.gmariotti.cardslib.library.internal.base.BaseCard) Card(it.gmariotti.cardslib.library.internal.Card)

Aggregations

Card (it.gmariotti.cardslib.library.internal.Card)6 CardArrayRecyclerViewAdapter (it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter)6 ArrayList (java.util.ArrayList)6 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)4 CardRecyclerView (it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView)4 BaseCard (it.gmariotti.cardslib.library.internal.base.BaseCard)3 CardTwowayView (it.gmariotti.cardslib.library.extra.twoway.view.CardTwowayView)2 SpacingItemDecoration (org.lucasr.twowayview.widget.SpacingItemDecoration)2 PicassoCard (it.gmariotti.cardslib.demo.extras.cards.PicassoCard)1 ProgressCard (it.gmariotti.cardslib.library.cards.ProgressCard)1 MaterialLargeImageCard (it.gmariotti.cardslib.library.cards.material.MaterialLargeImageCard)1