Search in sources :

Example 1 with IonCard

use of it.gmariotti.cardslib.demo.extras.cards.IonCard in project cardslib by gabrielemariotti.

the class IonFragment 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 < 200; i++) {
        IonCard card = new IonCard(this.getActivity());
        card.setTitle("A simple card loaded with Ion " + i);
        card.setSecondaryTitle("Simple text..." + i);
        card.setCount(i);
        cards.add(card);
    }
    CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);
    CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_extra_list_picasso);
    if (listView != null) {
        listView.setAdapter(mCardArrayAdapter);
    }
}
Also used : CardListView(it.gmariotti.cardslib.library.view.CardListView) IonCard(it.gmariotti.cardslib.demo.extras.cards.IonCard) ArrayList(java.util.ArrayList) CardArrayAdapter(it.gmariotti.cardslib.library.internal.CardArrayAdapter) IonCard(it.gmariotti.cardslib.demo.extras.cards.IonCard) Card(it.gmariotti.cardslib.library.internal.Card)

Aggregations

IonCard (it.gmariotti.cardslib.demo.extras.cards.IonCard)1 Card (it.gmariotti.cardslib.library.internal.Card)1 CardArrayAdapter (it.gmariotti.cardslib.library.internal.CardArrayAdapter)1 CardListView (it.gmariotti.cardslib.library.view.CardListView)1 ArrayList (java.util.ArrayList)1