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);
}
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);
}
}
Aggregations