ListView touch mode click on child views

by Xavier » Sat, 16 Jan 2010 02:07:16 GMT


Sponsored Links
 Hello,

This is driving me nuts. I have a ListView that uses an extended
ArrayAdapter<T>. Each row "cell.xml" contains a RelativeLayout and
within a few TextViews and ImageViews.

I have declared in the list xml definition a selector to change the
row background:

<item name="android:listSelector">@drawable/list_selector_background</
item>

It works. But only if the click (touch mode) not done over any of the
elements contained in the RelativeLayout. Any click outside this
elements will (correctly) trigger the selector. I have tried using
android:focusable="false" on each child view without avail.

What do I need to do to be able to trigger the selector, no matter
where the user clicks?

Thanks!



ListView touch mode click on child views

by Zsolt Vasvari » Sat, 16 Jan 2010 09:07:06 GMT


 Have you tried setting focusable="true" on the entire View the makes
up the list item?



> Thanks!


Sponsored Links


Other Threads

1. Mobile Developer Survey

A survey for mobile application developers has been posted at
http://openandroids.com . Take the
and be entered to win an Amazon voucher ...

The link to the survey is: 
http://openandroids.com/2008/06/09/mobile-application-developer-survey-have-your-say/
--~--~---------~--~----~------------~-------~--~----~

2. Drawing shape as ImageVIew

Hi
I hope somebody can help me with drawing an image using XML
declaration.
I need to draw a part of a "chat bubble", it's top and it's bottom. To
understand what i mean you can check out an example delivered with
android emulator  API Demos -> Graphics - > Drawable -> ShapeDrawable
The last one bubble in this example is what i need to be constructed
with head image(ImageView), TextView and bottom image(ImageView).
This is a bottom element:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
type="rectangle">
    <gradient android:startColor="#FFE1E1E1"
android:endColor="#FFFFFFFF"
            android:angle="270"/>
    <corners android:bottomLeftRadius="7dp"
                android:bottomRightRadius="7dp"
                android:topLeftRadius="1dp"
                android:topRightRadius="1dp"
                 />
</shape>

Top is the same, with only reverted values for angle radiuses.
So the problem this shape is drawn with a small unwanted rounding on
top of a rectangle.
Replacing topLeftRadius and topRightRadius values with 0dp doesn't
help, shapes are not drawn at all in this case :(
--~--~---------~--~----~------------~-------~--~----~

3. One of the best free sites - 7 exclusive, never seen sites where you can join for free and download lot of high quality dvd movies. No Credit Card Required

4. How to get constant waypoints for my locationbased service

5. Compairing EditText fields with if..else

6. Masked EditText

7. How to pass data between activities?