Search in sources :

Example 1 with SwipeDismissAnimation

use of it.gmariotti.cardslib.library.internal.dismissanimation.SwipeDismissAnimation in project cardslib by gabrielemariotti.

the class DismissAnimFragment method initCards.

private void initCards() {
    //Init an array of Cards
    ArrayList<Card> cards = new ArrayList<Card>();
    for (int i = 0; i < 200; i++) {
        Card card = initDismissCard(i);
        cards.add(card);
    }
    mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);
    dismissAnimation = (SwipeDismissAnimation) new SwipeDismissAnimation(getActivity()).setup(mCardArrayAdapter);
    CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_dismissanim);
    if (listView != null) {
        listView.setAdapter(mCardArrayAdapter);
    }
}
Also used : CardListView(it.gmariotti.cardslib.library.view.CardListView) ArrayList(java.util.ArrayList) SwipeDismissAnimation(it.gmariotti.cardslib.library.internal.dismissanimation.SwipeDismissAnimation) CardArrayAdapter(it.gmariotti.cardslib.library.internal.CardArrayAdapter) Card(it.gmariotti.cardslib.library.internal.Card)

Aggregations

Card (it.gmariotti.cardslib.library.internal.Card)1 CardArrayAdapter (it.gmariotti.cardslib.library.internal.CardArrayAdapter)1 SwipeDismissAnimation (it.gmariotti.cardslib.library.internal.dismissanimation.SwipeDismissAnimation)1 CardListView (it.gmariotti.cardslib.library.view.CardListView)1 ArrayList (java.util.ArrayList)1