Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to use a ViewFlipper or a new activity?

In my app I have a listview with news items showing only a summary, and when the user clicks on an item I switch to a new activity showing the full article in a webview. The user can go back to the list by pressing the return button, but I would like to make it possible to use a swype gesture too.

Now I have discovered the ViewFlipper, but I am in doubt of when to use it correctly. If I have understood it correctly, the ViewFlipper allows the user to loop through a series of views. So theoretically, a whole app could be made in only one activity and a viewflipper consisting of the different views needed. Of course, in most cases that wouldn't make sense.

Is there a rule of thumb of when to use a ViewFlipper or when to start new activities? In my specific case with the news app, would it be a candidate for a ViewFlipper (the details view in the same activity) or should I just stick to my current setup?

Also, I have got the idea that a ViewFlipper makes it easier to switch between screens using touch events (sliding between the views), is that correct?

An example of what I would like to achieve is how the app BeyondPod switches between screens using swype gestures.

like image 630
marlar Avatar asked Nov 26 '22 11:11

marlar


1 Answers

Using one activity with view flipper is very costly if you have more than 3-4 screens and complex layouts. One activity will initialize all view in view flipper and uses more resources. You can use activities and achieve any kind of animations for transitions or switching activities. Make activity light weight so that it will load fast use background tasks to do queries so that activities load fast.

like image 169
om252345 Avatar answered Dec 16 '22 05:12

om252345