Search code examples
androidviewflipper

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?


Solution

  • 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()