You can probably do this by:
- Creating your own styleable to declare the new attribute;
- Creating your own state-list drawable to use the new atribute;
- Setting it as the "listSelector" for the list view;
- Subclassing ListView to propagate the new attribute value into the
selector.
On the other hand, it's probably going to be easier to just set the
background color in your adapter's getView.
-- Kostya
13.01.2011 18:01, poohtbear пишет:
I have a list view with relativeLayout with all sorts of widgets
(TextViews, RatingBars, ImageViews etc...).
I use my own adapter to populate the ListView.
The items in the adapter, besides being selected \ pressed \not
focused have an extra state: 'viewed'.
Baiscally i want that items that have state viewed set to true will be
drawn with blue background and items with viewed set to false with
white\transparent background.
The problem is that i can't set the background on the View itself
since it will hide the selector, i'm not sure regarding adding extra
state since i know how to add it using addState on the current
selector, but i have no clue how to cause the list to use the extra
state, or how to use different selector for different item types.
Any help ?
--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en