Search in sources :

Example 1 with CardArrayRecyclerViewAdapter

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

the class GoogleProgressFragment method initCard.

/**
     * This method builds a simple list of cards
     */
private void initCard() {
    //Init an array of Cards
    ArrayList<Card> cards = new ArrayList<Card>();
    for (int i = 0; i < 20; i++) {
        GoogleProgressBarCard card = new GoogleProgressBarCard(this.getActivity());
        card.setTitle("A simple card loaded with Picasso " + i);
        card.setSecondaryTitle("Simple text..." + i);
        card.setCount(i);
        card.setId("" + i);
        card.setProgressBarViewStubLayoutId(R.layout.carddemo_native_smoothprogress);
        card.setUseProgressBar(true);
        cards.add(card);
    }
    //Set the adapter
    mCardArrayAdapter = new CardArrayRecyclerViewAdapter(getActivity(), cards);
    CardRecyclerView mRecyclerView = (CardRecyclerView) getActivity().findViewById(R.id.carddemo_extras_recycler_progress);
    mRecyclerView.setHasFixedSize(false);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    //Set the empty view
    if (mRecyclerView != null) {
        mRecyclerView.setAdapter(mCardArrayAdapter);
    }
}
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) ProgressCard(it.gmariotti.cardslib.library.cards.ProgressCard) Card(it.gmariotti.cardslib.library.internal.Card)

Example 2 with CardArrayRecyclerViewAdapter

use of it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter 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 3 with CardArrayRecyclerViewAdapter

use of it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter 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)

Example 4 with CardArrayRecyclerViewAdapter

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

the class NativeRecyclerViewFragment 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)

Example 5 with CardArrayRecyclerViewAdapter

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

the class NativeRecyclerViewMaterialCardFragment 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_recyclerview2);
    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) MaterialLargeImageCard(it.gmariotti.cardslib.library.cards.material.MaterialLargeImageCard) 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