Search in sources :

Example 1 with StickyListHeadersListViewWrapper

use of com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper 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)

Example 2 with StickyListHeadersListViewWrapper

use of com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper in project ListViewAnimations by nhaarman.

the class StickyListHeadersAdapterDecorator method setStickyListHeadersListView.

/**
     * Sets the {@link se.emilsjolander.stickylistheaders.StickyListHeadersListView} that this adapter will be bound to.
     */
public void setStickyListHeadersListView(@NonNull final StickyListHeadersListView listView) {
    ListViewWrapper stickyListHeadersListViewWrapper = new StickyListHeadersListViewWrapper(listView);
    setListViewWrapper(stickyListHeadersListViewWrapper);
}
Also used : ListViewWrapper(com.nhaarman.listviewanimations.util.ListViewWrapper) StickyListHeadersListViewWrapper(com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper) StickyListHeadersListViewWrapper(com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper)

Aggregations

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