Monday, April 26, 2010

Re: [android-developers] ViewFlipper with just one View

Mark Murphy wrote:
> Pinheiro wrote:
>> Hi!
>> I'm planning on creating an app with a news page with image, title,
>> content, etc.
>> The "flip" animations used in most ViewFlipper applications are great
>> but have one problem: only work with a ViewFlipper with a determinate
>> number of view (in my case, I don't know how many news there are).
>
> That's not strictly true, though most of the examples probably show
> that. You can always inflate something at runtime and call addView() to
> add it to the end of the flipper.

That being said, I think a variation of your original approach is
probably better. Have three ViewFlipper children, each a layout of your
news item. After a flip, populate one of the children for another
article, so you are always ready to flip in either direction (if you're
only flipping "forward", then you should only need two children).

Otherwise, if you have 100000000000 news articles, you will try
inflating 100000000000 children, and your average Android device won't
support that.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Consulting: http://commonsware.com/consulting

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment