The Android settings activity does exactly what I want... By default the text is WHITE and when the listitem is in a selected state the text changes color to BLACK... How did you do that?
On Jan 21, 5:03 pm, Mark Nuetzmann <[email protected]> wrote: > I understand how to do that if all I wanted was to change the look of > the background for the selected items in the list. However I do not > see how a statelist drawable will help me in this case. Each item in > the list is a RelativeLayout that contains an image and two > textviews. The textviews have a default text color of black. However > when the item is selected I want the color of the text for the > textviews to change to white. The StateListDrawable only affects the > background of the selected list item not the contents of the list > items themselves. I am fairly new at this so I could be completely > wrong here. I do appreciate the help you guys offer. It saves huge > amounts of time trying to research the correct way to handle these > issues. > > On Jan 21, 4:57 pm, Romain Guy <[email protected]> wrote: > > > > > Selected items in a listview are in the selected state, not in the > > focused state. You can use state drawables to achieve this. > > > On Thu, Jan 21, 2010 at 2:47 PM, Mark Nuetzmann > > > <[email protected]> wrote: > > > no problem. so, how do I how do I simply change the color of the text > > > for a textview when the item is selected? I obvisouly cannot use a > > > focus change listener. I also cannot add the code to my adpater > > > because it is only called when the view is needed and I see no way to > > > call onInvalidated() to ask the ListView to repaint the items... > > > > On Jan 21, 4:40 pm, Romain Guy <[email protected]> wrote: > > >> It's easy: don't use focusableInTouchMode. Especially since ListView > > >> already is focusable in touch mode. > > > >> On Thu, Jan 21, 2010 at 2:31 PM, Mark Nuetzmann > > > >> <[email protected]> wrote: > > >> > I am completely confused as to how the focusable and > > >> > focusableInTouchMode are supposed to work. If I set > > >> > focusableInTouchMode="true" for the items in my ListView the > > >> > ItemClickListener is never called. Why? > > > >> > I have the selector for the ListView set as a rect shape filled with a > > >> > solid color. As I scroll through the items in the list or touch one > > >> > of the items in the list I need to change the color of the text of > > >> > some textviews in the row item. If the item has focus or is selected > > >> > I need the text color to be white otherwise I need it to be black. I > > >> > thought it would be a simple matter to create a OnFocusChange listener > > >> > that would get called and have it respond based on the hasFocus value > > >> > passed in. This does not work at all. Is there a "suggested" method > > >> > of handling this (what seems to me) simple task? > > > >> > Regards, > > >> > Mark > > > >> > -- > > >> > 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 > > > >> -- > > >> Romain Guy > > >> Android framework engineer > > >> [email protected] > > > >> Note: please don't send private questions to me, as I don't have time > > >> to provide private support. All such questions should be posted on > > >> public forums, where I and others can see and answer them > > > > -- > > > 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 > > > -- > > Romain Guy > > Android framework engineer > > [email protected] > > > Note: please don't send private questions to me, as I don't have time > > to provide private support. All such questions should be posted on > > public forums, where I and others can see and answer them -- 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

