Monday, February 21, 2011

How to Reload the Same layout on View Flipper in Android?

I have an Linear Layout inside the View Flipper. When i fling/swipe the layout the same layout reloads the same layout with the animations slide_left_out and slide_right_in. I just have only one layout view. it has the values the image view and text view. When i swipe the view it just change the next value to that views. Any Idea?

From stackoverflow
  • How did you add the swipe/fling functionality? In other words, when the screen is "flung", that's where your code has to come in and "flip" the viewflipper to a different layout.

    AFAIK There isn't a built-in way to fling the viewflipper without having to write some code to handle the fling and manually change the viewflipper layout (index).

    EDIT:

    Basic Gesture Detection

    Flipping Views using ViewVlipper.setDisplayedChild()

    Praveen Chandrasekaran : can you explain with some example code?
    Brad Hein : That part of my code is copywritten but I added two links with detailed samples (possibly better than my own code :)

0 comments:

Post a Comment