Question

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.

Was it helpful?

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top