Search in sources :

Example 1 with GoogleNowWeatherCard

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

the class CardWithListFragment method initCard.

/**
     * This method builds a simple card
     */
private void initCard() {
    //Create a Card
    card = new GoogleNowWeatherCard(getActivity());
    card.init();
    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_weathercard);
    cardView.setCard(card);
    //Card
    card2 = new GoogleNowStockCardwithList(getActivity());
    card2.init();
    //Set card in the cardView
    CardView cardView2 = (CardView) getActivity().findViewById(R.id.carddemo_stockcard);
    cardView2.setCard(card2);
}
Also used : CardView(it.gmariotti.cardslib.library.view.CardView) GoogleNowWeatherCard(it.gmariotti.cardslib.demo.cards.GoogleNowWeatherCard) GoogleNowStockCardwithList(it.gmariotti.cardslib.demo.cards.GoogleNowStockCardwithList)

Example 2 with GoogleNowWeatherCard

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

the class CardWithListArrayFragment method initCard.

/**
     * This method builds a simple card
     */
private void initCard() {
    ArrayList<Card> cards = new ArrayList<Card>();
    for (int i = 0; i < 200; i++) {
        //Create a Card
        GoogleNowWeatherCard card = new GoogleNowWeatherCard(getActivity());
        card.init();
        cards.add(card);
    }
    CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);
    CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_cwl);
    if (listView != null) {
        listView.setAdapter(mCardArrayAdapter);
    }
}
Also used : CardListView(it.gmariotti.cardslib.library.view.CardListView) ArrayList(java.util.ArrayList) GoogleNowWeatherCard(it.gmariotti.cardslib.demo.cards.GoogleNowWeatherCard) CardArrayAdapter(it.gmariotti.cardslib.library.internal.CardArrayAdapter) GoogleNowWeatherCard(it.gmariotti.cardslib.demo.cards.GoogleNowWeatherCard) Card(it.gmariotti.cardslib.library.internal.Card)

Aggregations

GoogleNowWeatherCard (it.gmariotti.cardslib.demo.cards.GoogleNowWeatherCard)2 GoogleNowStockCardwithList (it.gmariotti.cardslib.demo.cards.GoogleNowStockCardwithList)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 CardView (it.gmariotti.cardslib.library.view.CardView)1 ArrayList (java.util.ArrayList)1