views:

316

answers:

1

I would like to create a ListView item layout where I can touch certain portions of a line item. This is similar to the behavior of the 2.0's Contacts Call Log where I can click on the green phone logo to initiate a call or click on the incoming call details to get more information about the contact.

I don't need a behavior only implementation. I already know to bind OnClickListeners to the portions of the line items where I want to capture the press. My real issue is that the UI doesn't react properly in certain cases when a user press against a certain area of the screen. IE: if they clicked the green phone icon, only the box around the phone will highlight as pressed. Where as pressing the name will highlight that area.

I looked at the source code for the contacts app but it's very complicated and I was able to get some success I have issues where the source code is referencing Drawables and resources that aren't exposed in the SDK itself.

I would like a reasonable implementation that does not rely on internal resource of android. Or at least some pointers in the right direction.

I'm looking for a solution that works with not only pressing but the 5-way directional keypad as well.

Here's a graphic that shows what I'm talking about.

Android Call Log

+1  A: 
Christopher
I have the behavior working fine. I do use the tag to determine how to operate and bind the OnClickListeners properly. The issue is that I cannot get the yellow-orangeish background to appear when the user presses against the widget properly in all cases. Particularly when they use the 5-key directional pad the text goes black as expected but the background stays black.
Jeremy Edwards