On Mon, Aug 29, 2011 at 8:57 AM, Jake Wharton <[email protected]> wrote:

> *Problem:*
>
> When using fragments with a ViewPager two two fragments which are adjacent
> to the currently selected page are instantiated and cached to provide smooth
> scrolling in either direction with as little lag as possible. If these
> fragments contribute menus to the activity options menu then their items
> will appear when positioned in these adjacent positions.
>

This should be fixed in the next update to the library.  We rushed quickly
to get the ViewPager code out in the last release because we thought it
would be useful even in its early form for developers, and to see how it
works out as people start using it.  (At the time of the release we had no
applications really using it yet; today we have quite a few apps in Android
using it as well as starting to hear from developers.)

We made the support library partly as a way to get some code out to
developers earlier in the development process, before we could commit to a
final design.  I am pretty sure ViewPager will end up in the framework
sometime down the road, but it is not yet to that point.  The API still
needs some work, and we have issues like not managing menus well.  (Also
DPAD navigation was completely lacking, and this will be improved in the
next update although I don't think it will be completely there.)  And based
on how quickly and extensively this class is becoming used in the apps I see
in the platform, it probably needs to go in the framework sooner rather than
later. :}

In the upcoming implementation, there is a new API on Fragment to tell it
whether it should show its menu, and a new API on PagerAdapter to tell it
which page is currently active.

-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Reply via email to