Thursday, September 22, 2011

Re: [android-developers] FragmentPager Scrolling

To clarify... 

Using the dpad left/right or trackball roll left/right doesn't 
simulate a swipe. All it does is set focus to an offscreen fragment. 
It doesn't actually change the fragment that is displayed on screen. 
(I have on screen buttons that will let the user "swipe" left/right if 
they are touch-screen challenged. I'm referring to the sample app 
because it is easier for folks to reproduce if they feel inclined.) 

The Android Market App doesn't do this. It appears to behave such that 
when you are on the pages that allow you to swipe left/right - the 
dpad/trackball options will let you select widgets up/down/left/right, 
but only on the on-screen fragment. 

Fragment #0 | Fragment #1 | Fragment #2 
<off screen>| <on screen> | <off screen> 

Each fragment presents a list. Scrolling left/right will move the 
focus between each of these fragments without changing which one is on 
screen. Selecting an item while the focus is off screen, will select 
whatever happens to be focused on the offscreen fragment. Not a great 
experience. 

To address your suggestions. I suppose it would be possible to trap 
the focus using the nextFocus<direction> options. The tricky part then 
is to know that your fragment has been made the on-screen fragment. 

The V4 (rel 3) compatibility library doesn't seem to expose that 
feature - or I've missed it completely. There doesn't appear to be an 
onChange type listener that let's me know when the fragment was 
changed. But I suppose that is a question for another post. 

In any event, it seems like this navigation paradigm is a little dodgy 
if it was intended to allow the user to select offscreen fragments and 
act on them. 

Thank you for your quick response. 

--
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