Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
FragmentPager Scrolling
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eric Carman  
View profile  
 More options Sep 22 2011, 8:25 am
From: Eric Carman <ewcarma...@gmail.com>
Date: Thu, 22 Sep 2011 05:25:28 -0700 (PDT)
Local: Thurs, Sep 22 2011 8:25 am
Subject: FragmentPager Scrolling
Using the compatibility library with the Fragment Pager Support
example, I'm noticing some odd behavior in the scrolling.

To reproduce:

1. Run the sample FragmentPagerSupport (v4)
2. From Fragment #1 scroll up and down using the dpad or trackball.
      - This works as expected.
3. Swipe to move to Fragment #2.
4. Scroll up and down using the dpad or trackball.

Nothing appears to happen. However, you are actually scrolling on
Fragment #1. Not the visible fragment. In fact, you can use the left/
right arrows (trackball roll left/right) to move the focus to the
offscreen fragments and scroll around on those.

If you connect an item click listener to the lists and display a toast
message, you will see that while scrolling on the off-screen
fragments, pressing the dpad-center or trackball, you will trigger the
click response for that offscreen list item.

I noticed this in my own application and confirmed with the sample
app.

Is there any way around this? Can we restrict focus/scrolling only to
the onscreen fragment?

Thank you.

Best Regards,
Eric


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Murphy  
View profile  
 More options Sep 22 2011, 8:47 am
From: Mark Murphy <mmur...@commonsware.com>
Date: Thu, 22 Sep 2011 08:47:34 -0400
Local: Thurs, Sep 22 2011 8:47 am
Subject: Re: [android-developers] FragmentPager Scrolling
Manually, that's probably a matter of:

-- setting the focus when you switch pages
-- using android:nextFocusDown and kin on your widgets to control how
the focus switches

(note that I haven't used the pager component yet, so the above advice
is an educated guess)

However, bear in mind that not everybody uses touchscreens. If you
make it impossible to navigate through all fragments with the pointing
device, you will alienate those users.

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

Warescription: Three Android Books, Plus Updates, One Low Price!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Carman  
View profile  
 More options Sep 22 2011, 6:27 pm
From: Eric Carman <ewcarma...@gmail.com>
Date: Thu, 22 Sep 2011 15:27:56 -0700 (PDT)
Local: Thurs, Sep 22 2011 6:27 pm
Subject: 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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Murphy  
View profile  
 More options Sep 22 2011, 6:30 pm
From: Mark Murphy <mmur...@commonsware.com>
Date: Thu, 22 Sep 2011 18:30:56 -0400
Local: Thurs, Sep 22 2011 6:30 pm
Subject: Re: [android-developers] FragmentPager Scrolling
Sorry, I misunderstood your original post.

Equally sorry, I have no suggestions.

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

Android Training...At Your Office: http://commonsware.com/training


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dianne Hackborn  
View profile  
 More options Sep 22 2011, 10:04 pm
From: Dianne Hackborn <hack...@android.com>
Date: Thu, 22 Sep 2011 19:04:03 -0700
Local: Thurs, Sep 22 2011 10:04 pm
Subject: Re: [android-developers] FragmentPager Scrolling

Sorry, this will be fixed in a future update.

--
Dianne Hackborn
Android framework engineer
hack...@android.com

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Carman  
View profile  
 More options Sep 23 2011, 8:29 am
From: Eric Carman <ewcarma...@gmail.com>
Date: Fri, 23 Sep 2011 05:29:08 -0700 (PDT)
Local: Fri, Sep 23 2011 8:29 am
Subject: Re: FragmentPager Scrolling
Thank you both for your time and efforts.

Best Regards,
Eric


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »