Search in sources :

Example 1 with CardTwowayView

use of it.gmariotti.cardslib.library.extra.twoway.view.CardTwowayView in project cardslib by gabrielemariotti.

the class List2wayFragment 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
    CardTwowayView mRecyclerView = (CardTwowayView) getActivity().findViewById(R.id.carddemo_extras_list_2wayview);
    mRecyclerView.setHasFixedSize(false);
    mRecyclerView.addItemDecoration(new SpacingItemDecoration(8, 8));
    //Set the empty view
    if (mRecyclerView != null) {
        mRecyclerView.setAdapter(mCardArrayAdapter);
    }
    //Load cards
    new LoaderAsyncTask().execute();
}
Also used : CardTwowayView(it.gmariotti.cardslib.library.extra.twoway.view.CardTwowayView) SpacingItemDecoration(org.lucasr.twowayview.widget.SpacingItemDecoration) ArrayList(java.util.ArrayList) CardArrayRecyclerViewAdapter(it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter) PicassoCard(it.gmariotti.cardslib.demo.extras.cards.PicassoCard) Card(it.gmariotti.cardslib.library.internal.Card)

Example 2 with CardTwowayView

use of it.gmariotti.cardslib.library.extra.twoway.view.CardTwowayView in project cardslib by gabrielemariotti.

the class StaggeredGrid2wayFragment 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
    CardTwowayView mRecyclerView = (CardTwowayView) getActivity().findViewById(R.id.carddemo_extras_grid_stag_2wayview);
    mRecyclerView.setHasFixedSize(false);
    mRecyclerView.addItemDecoration(new SpacingItemDecoration(8, 8));
    //Set the empty view
    if (mRecyclerView != null) {
        mRecyclerView.setAdapter(mCardArrayAdapter);
    }
    //Load cards
    new LoaderAsyncTask().execute();
}
Also used : CardTwowayView(it.gmariotti.cardslib.library.extra.twoway.view.CardTwowayView) SpacingItemDecoration(org.lucasr.twowayview.widget.SpacingItemDecoration) ArrayList(java.util.ArrayList) CardArrayRecyclerViewAdapter(it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter) Card(it.gmariotti.cardslib.library.internal.Card)

Aggregations

CardTwowayView (it.gmariotti.cardslib.library.extra.twoway.view.CardTwowayView)2 Card (it.gmariotti.cardslib.library.internal.Card)2 CardArrayRecyclerViewAdapter (it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter)2 ArrayList (java.util.ArrayList)2 SpacingItemDecoration (org.lucasr.twowayview.widget.SpacingItemDecoration)2 PicassoCard (it.gmariotti.cardslib.demo.extras.cards.PicassoCard)1