Search code examples
androidviewflipperandroid-animationfeed

Push Up animation in android?


I need to implement a news feed in my android application. It should animate like the push up animation in API Demos. But In my application I get A object Array which contains image and its heading. How can I animate the news feed using ViewFlipper or any other way ?

Thanks in Advance !


Solution

  • In AniationFactory.java there is the function outFromBottom()

    So lets say you have yourView and you want to add it to a vertical LinearLayout called feedLL.

    Use the following code:

    Animation animation = AnimationFactory.inFromBottom();
    animation.setDuration(1000);
    yourView.setVisibility(View.GONE);
    yourView.setAnimation(animation);
    feedLL.addView(yourView);
    yourView.setVisibility(View.VISIBILE);