Search in sources :

Example 1 with StickyListHeadersAdapterDecorator

use of com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator in project ListViewAnimations by nhaarman.

the class StickyListHeadersActivity method onCreate.

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_stickylistheaders);
    StickyListHeadersListView listView = (StickyListHeadersListView) findViewById(R.id.activity_stickylistheaders_listview);
    listView.setFitsSystemWindows(true);
    MyListAdapter adapter = new MyListAdapter(this);
    AlphaInAnimationAdapter animationAdapter = new AlphaInAnimationAdapter(adapter);
    StickyListHeadersAdapterDecorator stickyListHeadersAdapterDecorator = new StickyListHeadersAdapterDecorator(animationAdapter);
    stickyListHeadersAdapterDecorator.setListViewWrapper(new StickyListHeadersListViewWrapper(listView));
    assert animationAdapter.getViewAnimator() != null;
    animationAdapter.getViewAnimator().setInitialDelayMillis(500);
    assert stickyListHeadersAdapterDecorator.getViewAnimator() != null;
    stickyListHeadersAdapterDecorator.getViewAnimator().setInitialDelayMillis(500);
    listView.setAdapter(stickyListHeadersAdapterDecorator);
}
Also used : AlphaInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter) StickyListHeadersListView(se.emilsjolander.stickylistheaders.StickyListHeadersListView) StickyListHeadersAdapterDecorator(com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator) StickyListHeadersListViewWrapper(com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper)

Aggregations

StickyListHeadersAdapterDecorator (com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator)1 AlphaInAnimationAdapter (com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter)1 StickyListHeadersListViewWrapper (com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper)1 StickyListHeadersListView (se.emilsjolander.stickylistheaders.StickyListHeadersListView)1