The targetSdk is 11.
This is our hierarchy:

-ViewPager 
  | 
  +-NoSaveStateFrameLayout
       | 
       +-ProfileGridView
              |
              +-ProfileGridViewRow
                      |
                      +-FrameLayout
                            |
                            +-TextView

Note that ProfileGridView contains one or more ProfileGridViewRows which 
contains one or more clickable TextView  (i.e. our buttons).
The ProfileGridView and ProfileGridViewRow are custom LinearyLayouts: The 
have their own measure and layout-logic. These two subclasses don't have 
any method or logic to capture or handle touch-events.

Thanks!

On Tuesday, October 9, 2012 11:31:03 AM UTC-4, Piren wrote:
>
> ViewPager is part of the support package and inherits from a ViewGroup , 
> it shouldn't matter much which OS version it runs on.
> I have a similar setup and i dont experience this issue (using support 
> package v4, i assume you're using the same since you said you tested on 
> earlier os versions).
> I can even press a button and see it switch to its pressed state and then 
> start a swipe without generating an onClick event.
>
> What is your targetSdkVersion? 
>
> On Tuesday, October 9, 2012 4:27:31 PM UTC+2, Streets Of Boston wrote:
>>
>> Hi Kostya,
>>
>> Thanks for your answer.
>>
>> This bug (?) only happens on Jelly Bean (I don't have ICS devices to test 
>> it on).
>> It works fine on Honeycomb and lower OS versions. 
>>
>> It seems there is indeed a regression of the ViewPager in JB (and 
>> possibly ICS).
>>
>> Thanks.
>>
>> On Tuesday, October 2, 2012 12:47:41 PM UTC-4, Kostya Vasilyev wrote:
>>>
>>> Sounds like a bug in how ViewPager dispatches events (sorry for stating 
>>> the obvious). I'd consider looking at the source and comparing it to 
>>> ScrollView (which handles nested touchable areas just fine).
>>>
>>> -- K
>>>
>>> 2012/10/2 Streets Of Boston <[email protected]>
>>>
>>>> Hi everyone,
>>>>
>>>> I have a ViewPager that contains pages, each page with a bunch of 
>>>> Buttons (or clickable TextViews). When I set the buttons to 
>>>> 'setClickable(false)', swiping the ViewPager to another page works fine 
>>>> all 
>>>> the time.
>>>>
>>>> However, when the buttons are clickable (OnClick listener is set), the 
>>>> ViewPager won't do anything if the user put his or her finger down on the 
>>>> button when he or she starts a swipe or scroll. If the user swipes, the 
>>>> button 'eats' all the touch-events (MotionEvents).
>>>>
>>>> Is there a convenient way to make these buttons/textviews clickable and 
>>>> make the ViewPager swipe even if the user puts his finger on a button 
>>>> initially?
>>>> (I'd like to avoid hacks and using GestureDetectors if possible)
>>>>
>>>> Thanks!
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Android Developers" group.
>>>> To post to this group, send email to 
>>>> To unsubscribe from this group, send email to
>>>>
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/android-developers?hl=en
>>>
>>>
>>>

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