Setting gradient color of TextView creates problems with selection color

by ChisterNordvik » Mon, 03 Nov 2008 13:38:29 GMT

Sponsored Links

I have a ListView with lines of TextViews (standings table for Premier

In the first column I want to have a gradient so I have modified my
code like this:

//Top team should have a nice green color
if(position == 0)
        toColor = Color.argb(255, 79, 191, 124);
        grad = new GradientDrawable(Orientation.TOP_BOTTOM,
                        new int[]{Color.GREEN, Color.BLACK, Color.GREEN});

But the selector is not happy with this because the gradient is at the
top of the selector. I tried painting the selector at the top with

But I couldn't get that to look any good. I also tried handling the
selectionChange property of the listview and setting background color
there but how can I clear the selection color when the listItem looses
selection? Do I have to loop through every item?

Are there any better ways of doing this?

Really appreciate any answers!


Other Threads

1. Beagleboard Rev C4 Android Porting Efforts

Hi All,

  I am porting Android on Beagle-board Rev C4 OMAP 3530.

  Can any provide me guidelines to port Android, I checked for Emblinux for
Android porting from where I have downloaded Android Sources and Linux
kernel for Android, but I am not sure about how to port *Boot loader* to
Beagle board C4 Rev.

  I would appreciate if anyone give me pointers on boot-loader porting or
any links which can make my job easy in porting Android.



2. How to recreate and reinflate a ViewStub?

Can I download the project somewhere to see how it works??

> > > > 

3. OOT : Flexi going EVDO, alternatif lain buat ngempanin android :)

4. Androlib Desire Froyo, based on official FROYO, a2sd+, new boot animation, tweaking, trackpad wake up, super cyrcle battery mod

5. /sys/devices/virtual/switch/usb_mass_storage/state Not present

6. Rooting Wildfire

7. How to populate a ViewStub using different ImageButtons?