Does this work if the layout is used outside of a list view?

On Sat, Nov 13, 2010 at 12:29 PM, FractalBob <ruom...@gmail.com> wrote:

>
>
> On Nov 13, 11:45 am, Dianne Hackborn <hack...@android.com> wrote:
> > Where are you attaching your listeners?  Are you taking into account view
> > recycling?  This is not generally something one wants to do in a list
> view,
> > and if you do go down this path you need to be very careful about
> > understanding how list view works with recycling views and such.
> >
> I'm attaching my listeners in the getView() method of the adapter I
> use to load the list. As for view recycling, I don't see why that
> would be an issue.
> >
> >
> >
> >
> >
> >
> >
> >
> > On Sat, Nov 13, 2010 at 11:20 AM, FractalBob <ruom...@gmail.com> wrote:
> > > Hi,
> >
> > > I have a list that contains views consisting an ImageView followed on
> > > the right by a TextView:
> >
> > >    <LinearLayout
> > >        android:orientation="horizontal"
> > >        android:layout_width="fill_parent"
> > >        android:layout_height="wrap_content">
> > >        <ImageView android:id="@+id/news_image"
> > >            android:layout_width="88dp"
> > >            android:layout_height="66dp"
> > >            android:padding="10dp" />
> > >        <TextView android:id="@+id/news_text"
> > >            android:lines="4"
> > >            android:inputType="textMultiLine"
> > >            android:layout_marginTop="5dp"
> > >            android:text="@string/LANGKEY_headlines_unavailable"
> > >            android:layout_width="fill_parent"
> > >            android:layout_height="wrap_content"/>
> > >    </LinearLayout>
> >
> > > I implemented fling the usual way, as follows:
> >
> > >            listItemView.setOnClickListener(NewsListActivity.this);
> > >            listItemView.setOnTouchListener(gestureListener);
> >
> > > where listItemView is the above view.
> >
> > > Now, if I begin the fling on the ImageView, I see it. But if I begin
> > > it in the TextView, I don't; also, mouse down on the TextView causes
> > > the tyext to disappear until the mouse is released (I don't know if
> > > that's relevant, but I thought I'd mention it). It seems that Android
> > > attaches the listeners to the first view in the layout, which looks
> > > like a bug to me. How can I get Android to recognize flings (and
> > > clicks) anywhere in the view?
> >
> > > --
> > > 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<android-developers%2bunsubscr...@googlegroups.com><android-developers%2Bunsubs
> cr...@googlegroups.com>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
> >
> > --
> > 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 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<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



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