I'm working on creating a swipe-to-dismiss list view adapter. My basic 
methodology is to wrap the list item's view as the second view in a 
ViewPager and provide the necessary callbacks in the item change listener 
of the ViewPager. Through much pain I've got the View recycler working as 
intended, as well as ViewHolder and ViewBinder patterns implemented. I even 
managed to keep the ListView from taking over the touch events while the 
ViewPager is being scrolled without having to make a custom subclass of 
ListView (I can do it all from the Adapter).

Where I'm running into trouble is getting the selector and the 
OnItemClickListener to work. After looking at ListView's source it seemed 
that by overriding the ViewPager's hasFocusable() method to always return 
false (later on I'll pull this value from the child view) the ListView 
would be "tricked" into thinking the ViewPager wasn't clickable and would 
enable them. Unfortunately this is not the case. I've tried the 
setDecendantFocusability()workaround and I'm still stuck.

I'd like to avoid having to extend ListView if possible to provide the 
greatest amount of modularity. For similar reasons I don't want to add the 
selector to the ViewPager's background (if the dev changes the ListView's 
selector this wouldn't be reflected). Essentially I'm looking to make the 
ViewPager code transparent between the ListView and child View. Any ideas?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to