Ok, I can understand that.... Kind of. Shouldn't the gallery's pointToPosition() method return the Viewable index then, instead of the absolute index? What good is an index position if I can't do anything with it?
As an example to see if I understand this right: If I have 20 items, and scroll to the 16th... then that means items 14 - 18 are visible. Which in turn means that according to the gallery the item at position 0 is really the 14th and the item at position 5 is really the 18th? If that is the case, what can I do to get the view I want? Thanks, Justin ---------------------------------------------------------------------- There are only 10 types of people in the world... Those who know binary and those who don't. ---------------------------------------------------------------------- On Mon, Sep 14, 2009 at 12:14 PM, Romain Guy <[email protected]> wrote: > > The child count of a Gallery represents how many children the Gallery > can display on screen. It's not a problem, that's how Gallery works. > It only has enough views to "fill" the screen. > > On Mon, Sep 14, 2009 at 9:59 AM, Tikoze <[email protected]> wrote: > > > > I have run into an interesting problem using the Gallery Object. I am > > doing some custom gesture detection in an onFling() method and get a > > null view object when the index of the view I am trying to get is 6 or > > above. > > > > The following line of code works fine for positions 0 - 5 but > > closeView is always null with positions 6+: > > > > int pos = m_runningGallery.pointToPosition((int)e1.getX(), (int)e1.getY > > ()); > > View closeView = m_runningGallery.getChildAt(pos); > > > > In doing some debugging, it looks like the gallery object ALWAYS > > reports 6 children, regardless of the number of children actually in > > the view. > > > > Has anyone else encountered this problem and/or found a solution to > > this? > > > > Thanks in advance, > > Justin > > > > > > > > > > > > > > > -- > Romain Guy > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time > to provide private support. All such questions should be posted on > public forums, where I and others can see and answer them > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" 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-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

