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