use of it.gmariotti.cardslib.library.view.CardGridView in project cardslib by gabrielemariotti.
the class GridGplayFragment method initCards.
private void initCards() {
ArrayList<Card> cards = new ArrayList<Card>();
for (int i = 0; i < 200; i++) {
GplayGridCard card = new GplayGridCard(getActivity());
card.headerTitle = "App example " + i;
card.secondaryTitle = "Some text here " + i;
card.rating = (float) (Math.random() * (5.0));
//Only for test, change some icons
if ((i % 6 == 0)) {
card.resourceIdThumbnail = R.drawable.ic_ic_dh_bat;
} else if ((i % 6 == 1)) {
card.resourceIdThumbnail = R.drawable.ic_ic_dh_net;
} else if ((i % 6 == 2)) {
card.resourceIdThumbnail = R.drawable.ic_tris;
} else if ((i % 6 == 3)) {
card.resourceIdThumbnail = R.drawable.ic_info;
} else if ((i % 6 == 4)) {
card.resourceIdThumbnail = R.drawable.ic_smile;
}
card.init();
cards.add(card);
}
CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(getActivity(), cards);
CardGridView listView = (CardGridView) getActivity().findViewById(R.id.carddemo_grid_base1);
if (listView != null) {
listView.setAdapter(mCardArrayAdapter);
}
}
use of it.gmariotti.cardslib.library.view.CardGridView in project cardslib by gabrielemariotti.
the class NativeGridGplayFragment method initCards.
private void initCards() {
ArrayList<Card> cards = new ArrayList<Card>();
for (int i = 0; i < 200; i++) {
GplayGridCard card = new GplayGridCard(getActivity());
card.headerTitle = "App example " + i;
card.secondaryTitle = "Some text here " + i;
card.rating = (float) (Math.random() * (5.0));
//Only for test, change some icons
if ((i % 6 == 0)) {
card.resourceIdThumbnail = R.drawable.ic_ic_dh_bat;
} else if ((i % 6 == 1)) {
card.resourceIdThumbnail = R.drawable.ic_ic_dh_net;
} else if ((i % 6 == 2)) {
card.resourceIdThumbnail = R.drawable.ic_tris;
} else if ((i % 6 == 3)) {
card.resourceIdThumbnail = R.drawable.ic_info;
} else if ((i % 6 == 4)) {
card.resourceIdThumbnail = R.drawable.ic_smile;
}
card.init();
cards.add(card);
}
CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(getActivity(), cards);
CardGridView listView = (CardGridView) getActivity().findViewById(R.id.carddemo_grid_base1);
if (listView != null) {
listView.setAdapter(mCardArrayAdapter);
}
}
use of it.gmariotti.cardslib.library.view.CardGridView in project cardslib by gabrielemariotti.
the class GridBaseFragment method initCards.
private void initCards() {
ArrayList<Card> cards = new ArrayList<Card>();
for (int i = 0; i < 200; i++) {
GdriveGridCard card = new GdriveGridCard(getActivity());
card.headerTitle = "Folder " + i;
card.init();
cards.add(card);
}
CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(getActivity(), cards);
CardGridView gridView = (CardGridView) getActivity().findViewById(R.id.carddemo_grid_base);
if (gridView != null) {
gridView.setAdapter(mCardArrayAdapter);
}
}
Aggregations