Search in sources :

Example 1 with CardRecyclerView

use of it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView 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 CardRecyclerView

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

Example 3 with CardRecyclerView

use of it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView 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 4 with CardRecyclerView

use of it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView 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

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)4 Card (it.gmariotti.cardslib.library.internal.Card)4 CardArrayRecyclerViewAdapter (it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter)4 CardRecyclerView (it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView)4 ArrayList (java.util.ArrayList)4 BaseCard (it.gmariotti.cardslib.library.internal.base.BaseCard)3 ProgressCard (it.gmariotti.cardslib.library.cards.ProgressCard)1 MaterialLargeImageCard (it.gmariotti.cardslib.library.cards.material.MaterialLargeImageCard)1