Search in sources :

Example 1 with AlphaInAnimationAdapter

use of com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter 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 AlphaInAnimationAdapter

use of com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter in project cardslib by gabrielemariotti.

the class ListViewGridAnimationsFragment method setAlphaAdapter.

/**
     * Alpha animation
     */
private void setAlphaAdapter() {
    AnimationAdapter animCardArrayAdapter = new AlphaInAnimationAdapter(mCardArrayAdapter);
    animCardArrayAdapter.setAbsListView(mListView);
    mListView.setExternalAdapter(animCardArrayAdapter, mCardArrayAdapter);
}
Also used : AlphaInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter) SwingRightInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.SwingRightInAnimationAdapter) SwingLeftInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.SwingLeftInAnimationAdapter) ScaleInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.ScaleInAnimationAdapter) AlphaInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter) AnimationAdapter(com.nhaarman.listviewanimations.appearance.AnimationAdapter) SwingBottomInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.SwingBottomInAnimationAdapter)

Example 3 with AlphaInAnimationAdapter

use of com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter in project cardslib by gabrielemariotti.

the class AnimateStaggeredGridFragment method setAlphaAdapter.

/**
     * Alpha animation
     */
private void setAlphaAdapter() {
    AnimationAdapter animCardArrayAdapter = new AlphaInAnimationAdapter(mCardArrayAdapter);
    setCommonAnimation(animCardArrayAdapter);
    animCardArrayAdapter.setAbsListView(staggeredView);
    staggeredView.setExternalAdapter(animCardArrayAdapter, mCardArrayAdapter);
}
Also used : AlphaInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter) SwingRightInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.SwingRightInAnimationAdapter) SwingLeftInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.SwingLeftInAnimationAdapter) ScaleInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.ScaleInAnimationAdapter) AlphaInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter) AnimationAdapter(com.nhaarman.listviewanimations.appearance.AnimationAdapter) SwingBottomInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.SwingBottomInAnimationAdapter)

Example 4 with AlphaInAnimationAdapter

use of com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter in project cardslib by gabrielemariotti.

the class NativeDragDropListFragment method setAlphaAdapter.

//-------------------------------------------------------------------------------------------------------------
// Animations. (these method aren't used in this demo, but they can be called to enable the animations)
//-------------------------------------------------------------------------------------------------------------
/**
     * Alpha animation
     */
private void setAlphaAdapter() {
    AnimationAdapter animCardArrayAdapter = new AlphaInAnimationAdapter(mCardArrayAdapter);
    animCardArrayAdapter.setAbsListView(mListView);
    if (mListView != null) {
        mListView.setExternalAdapter(animCardArrayAdapter, mCardArrayAdapter);
    }
}
Also used : AlphaInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter) SwingLeftInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.SwingLeftInAnimationAdapter) ScaleInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.ScaleInAnimationAdapter) SwingRightInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.SwingRightInAnimationAdapter) AlphaInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter) AnimationAdapter(com.nhaarman.listviewanimations.appearance.AnimationAdapter) SwingBottomInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.SwingBottomInAnimationAdapter)

Example 5 with AlphaInAnimationAdapter

use of com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter in project cardslib by gabrielemariotti.

the class NativeExpandPicassoFragment method initCard.

/**
     * This method builds a simple cards list
     */
private void initCard() {
    //Only for test scope, use images on assets folder
    String[] fileName = { "file:///android_asset/images/sea.jpg", "file:///android_asset/images/snow.jpg", "file:///android_asset/images/water.jpg", "file:///android_asset/images/img2.jpg", "file:///android_asset/images/rose.jpg" };
    //Only for test scope, use 5 different header titles
    int[] resTitleId = { R.string.carddemo_extras_header_expand_area_inside_sea, R.string.carddemo_extras_header_expand_area_inside_snow, R.string.carddemo_extras_header_expand_area_inside_water, R.string.carddemo_extras_header_expand_area_inside_img2, R.string.carddemo_extras_header_expand_area_inside_rose };
    //Remove debugging from Picasso
    Picasso.with(getActivity()).setDebugging(false);
    //Init an array of Cards
    ArrayList<Card> cards = new ArrayList<Card>();
    for (int j = 1; j < 30; j++) {
        for (int i = 0; i < 10; i++) {
            //Card
            CardInside card = new CardInside(this.getActivity());
            //Create a CardHeader
            CardHeader header = new CardHeader(getActivity(), R.layout.carddemo_extras_expandinside_inner_base_header);
            if (i % 2 == 0) {
                //Set the header title
                header.setTitle(getString(resTitleId[(int) (i / 2) % 5]));
                //Add Header to card
                card.addCardHeader(header);
                //Add an expand area
                CardExpandInside expand = new CardExpandInside(getActivity(), fileName[(int) (i / 2) % 5]);
                card.addCardExpand(expand);
            } else {
                //Set the header title
                header.setTitle(getString(R.string.carddemo_extras_header_expand_area_inside));
                //Add Header to card
                card.addCardHeader(header);
                //Only for test scope, use a random number
                int randomNumber = (int) (Math.random() * 6);
                //Add an expand area
                CardExpandInsideSquare expand = new CardExpandInsideSquare(getActivity(), randomNumber);
                card.addCardExpand(expand);
            }
            //Add a viewToClickExpand to enable click on whole card
            ViewToClickToExpand viewToClickToExpand = ViewToClickToExpand.builder().highlightView(false).setupCardElement(ViewToClickToExpand.CardElementUI.CARD);
            card.setViewToClickToExpand(viewToClickToExpand);
            cards.add(card);
        }
    }
    //Set the arrayAdapter
    CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);
    CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_extra_list_mixinside);
    //Add an animator
    AnimationAdapter animCardArrayAdapter = new AlphaInAnimationAdapter(mCardArrayAdapter);
    animCardArrayAdapter.setAbsListView(listView);
    //animCardArrayAdapter.setInitialDelayMillis(500);
    if (listView != null) {
        listView.setExternalAdapter(animCardArrayAdapter, mCardArrayAdapter);
    }
}
Also used : ViewToClickToExpand(it.gmariotti.cardslib.library.internal.ViewToClickToExpand) AlphaInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter) ArrayList(java.util.ArrayList) CardHeader(it.gmariotti.cardslib.library.internal.CardHeader) CardArrayAdapter(it.gmariotti.cardslib.library.internal.CardArrayAdapter) Card(it.gmariotti.cardslib.library.internal.Card) CardListView(it.gmariotti.cardslib.library.view.CardListView) AlphaInAnimationAdapter(com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter) AnimationAdapter(com.nhaarman.listviewanimations.appearance.AnimationAdapter)

Aggregations

AlphaInAnimationAdapter (com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter)11 AnimationAdapter (com.nhaarman.listviewanimations.appearance.AnimationAdapter)7 ScaleInAnimationAdapter (com.nhaarman.listviewanimations.appearance.simple.ScaleInAnimationAdapter)5 SwingBottomInAnimationAdapter (com.nhaarman.listviewanimations.appearance.simple.SwingBottomInAnimationAdapter)5 SwingLeftInAnimationAdapter (com.nhaarman.listviewanimations.appearance.simple.SwingLeftInAnimationAdapter)5 SwingRightInAnimationAdapter (com.nhaarman.listviewanimations.appearance.simple.SwingRightInAnimationAdapter)5 Card (it.gmariotti.cardslib.library.internal.Card)2 CardArrayAdapter (it.gmariotti.cardslib.library.internal.CardArrayAdapter)2 CardHeader (it.gmariotti.cardslib.library.internal.CardHeader)2 ViewToClickToExpand (it.gmariotti.cardslib.library.internal.ViewToClickToExpand)2 CardListView (it.gmariotti.cardslib.library.view.CardListView)2 ArrayList (java.util.ArrayList)2 StickyListHeadersAdapterDecorator (com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator)1 DynamicListView (com.nhaarman.listviewanimations.itemmanipulation.DynamicListView)1 TouchViewDraggableManager (com.nhaarman.listviewanimations.itemmanipulation.dragdrop.TouchViewDraggableManager)1 SimpleSwipeUndoAdapter (com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.undo.SimpleSwipeUndoAdapter)1 StickyListHeadersListViewWrapper (com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper)1 StickyListHeadersListView (se.emilsjolander.stickylistheaders.StickyListHeadersListView)1