I'm trying to make an activity that has a multipage layout with previous/next buttons, etc. I know I could make a separate activity for each page, but that seems like a pain. After much experimentation, the best I can come up with is that I can use ViewAnimator to do what I want...however, I'm curious if anybody has any better ideas, especially since ViewAnimator doesn't have a showPrevious() method for some odd reason. Maybe I'm completely overlooking something obvious, as this seems like a pretty basic thing to want to do.
Here's what I'm doing:
- Code: Select all
//get the ViewAnimator from the XML
va = (ViewAnimator)findViewById(R.id.view_animator);
//demo of how to show next page
va.showNext();
//there's no show previous page function...I wonder why...
//...
//go back to page 0
va.setDisplayedChild(0);
I did try PageTurner, but couldn't get it to work right. All of the children were displayed at the same time, so I could see page 2 beneath page 1. I also saw some mention on the Google dev group that PageTurner is being removed from the SDK in the next version. I thought of using ViewGroup too, but haven't really been able to find much in the way of an example of how to use ViewGroup, or even if it's suited to this task.
Anyway, I'd really appreciate some input from any of you.
Thanks,
Tom




