Hi Kostya.
1. i know how to add a new attribute to the selector, i can do it
programatically using the original list's selector and save me some
work.
2. in StateListDrawable you have a protected method that acts on those
states, and it's stated specifically that you need to override it to
act on your own states, so just adding a state will not do, i need my
own StateListDrawable.
3. how and where in ListView the selector states are determined ?
KeyDown\KeyUp events ? pointerPressed events ? is there a  main
function where it all goes to to set the current selector state on a
specific list item that i can override ? i'm not sure this method wont
be private making me override lots of other methods...
4. it would have been easier if you could just post a simple selector
xml and a short ListView example that uses the new state, what you
wrote here is pretty much just stating the obvious in high level
without giving the specific details i wondered about...

5. i think i explained that i can't just 'set the background' because
than the selected and clicked drawables will be hidden by that
background. i didn't check though what will happen if the background
will be StateListDrawable itself.

On Jan 13, 5:21 pm, Kostya Vasilyev <kmans...@gmail.com> wrote:
> 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 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