0

I'm trying to achieve the effect that is part of the android google talk application on the chat window. The effect is that there is a static top and bottom, but you can swipe between the various open chats that you have.

in other words, I'm trying to design a screen where there's a static section on top and on the bottom and a dynamic part in the center, think of a gallery app, where it shows you the title on top, a "show next image" button on the bottom and a picture in the center that gets replaced with the same transition you would see when switching between activities, only difference is that instead of an image, I need a more complex layout to be replaced in the center (a couple of text views and an image)

How should I go about doing that? I thought about animations but it seems too complicated, and I thought about fragments but i don't know if it's supported on all versions or not and I also thought of drawing in runtime using the inflater but that doesnt let me do the "next activity" effect.

ekatz
  • 963
  • 3
  • 18
  • 38

3 Answers3

3

Try the ViewFlipper class. It's what you're looking for. Here are some examples:

http://android-pro.blogspot.com/2010/09/using-view-flipper-in-android.html
http://www.androidpeople.com/android-viewflipper-example/

Kevin Coppock
  • 133,643
  • 45
  • 263
  • 274
1

You could use a RelativeLayout and have your header view aligned to the top of it, your footer view aligned to the bottom, and a middle Gallery view (or some layout that contains the views that will be changed) that is above the footer view and below the header view.

BigFwoosh
  • 1,197
  • 10
  • 17
0

IF you're not interested in the animations, you can just put all of your layouts in the screen and play with View.GONE/View.VISIBLE/View.INVISIBLE flags. use the tag for nicer coding.

oriharel
  • 10,418
  • 14
  • 48
  • 57