Search in sources :

Example 1 with SwipeDismissAdapter

use of com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.SwipeDismissAdapter in project ListViewAnimations by nhaarman.

the class GoogleCardsActivity method onCreate.

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_googlecards);
    ListView listView = (ListView) findViewById(R.id.activity_googlecards_listview);
    mGoogleCardsAdapter = new GoogleCardsAdapter(this);
    SwingBottomInAnimationAdapter swingBottomInAnimationAdapter = new SwingBottomInAnimationAdapter(new SwipeDismissAdapter(mGoogleCardsAdapter, this));
    swingBottomInAnimationAdapter.setAbsListView(listView);
    assert swingBottomInAnimationAdapter.getViewAnimator() != null;
    swingBottomInAnimationAdapter.getViewAnimator().setInitialDelayMillis(INITIAL_DELAY_MILLIS);
    listView.setAdapter(swingBottomInAnimationAdapter);
    for (int i = 0; i < 100; i++) {
        mGoogleCardsAdapter.add(i);
    }
}
Also used : ListView(android.widget.ListView) SwipeDismissAdapter(com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.SwipeDismissAdapter) SwingBottomInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.SwingBottomInAnimationAdapter)

Aggregations

ListView (android.widget.ListView)1 SwingBottomInAnimationAdapter (com.nhaarman.listviewanimations.appearance.simple.SwingBottomInAnimationAdapter)1 SwipeDismissAdapter (com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.SwipeDismissAdapter)1