[android-developers] Viewpager overscrolls when width is changed when swiping

2012-12-12 Thread spotleo
Dear all, I am having trouble with ViewPager overscrolling to the next or previous page if ViewPager's width is changed in onPageSelected. I'm looking at ViewPager's setCurrentItemInternal code and the steps of swiping to the next page seems to be 1. smoothScrollTo 2. calls onPageSelecte

[android-developers] Re: Safe to add Fragment into ListView?

2012-05-14 Thread spotleo
Hi Nadeem, The reason why I chose fragment over widget is that fragment has callback methods such as onCreate(), onResume, onPause, onDestroy that I need in order for my UI component to work properly. This implies that clients can just declare my fragment in their layout and it'll all work. If

Re: [android-developers] Re: Safe to add Fragment into ListView?

2012-05-14 Thread spotleo
for an > answer, and probably could have figured it out in a matter of hours by just > trying it to see what happens. > > Thanks, > Justin Anderson > MagouyaWare Developer > http://sites.google.com/site/magouyaware > > > On Mon, May 14, 2012 at 7:15 AM, spotleo wrote

[android-developers] Re: Safe to add Fragment into ListView?

2012-05-14 Thread spotleo
Dianne or Romain Guy? Or anyone else can provide any suggestions? On Thursday, April 26, 2012 1:45:34 PM UTC+8, spotleo wrote: > > Hi, > > I have a reusable UI component Fragment A that has been used > throughout various Activities and they all worked fine. > The c

[android-developers] Placing Fragment into Listview item

2012-04-26 Thread spotleo
I know it is possible to place ListView into Fragment, aka. ListFragment. But is it possible to place Fragment into ListView? What I'm trying to achieve is I created a reusable Fragment A that works fine anywhere outside ListView using setContentView, but when I try to inflate Fragment A into a Li

[android-developers] Problem when placing Fragment into Listview item

2012-04-26 Thread spotleo
Hi, I know it is possible to place ListView into Fragment, aka. ListFragment. But is it possible to place Fragment into ListView? What I'm trying to achieve is I created a reusable Fragment A that works fine anywhere outside ListView, but when I try to inflate Fragment A into a ListView item,

[android-developers] Safe to add Fragment into ListView?

2012-04-26 Thread spotleo
Hi, I have a reusable UI component Fragment A that has been used throughout various Activities and they all worked fine. The controller logic is placed inside Fragment A whereas the view layer is defined in Fragment A's layout file. Now I have a requirement to add Fragment A into part of List