[android-developers] Listview Selector

2012-09-12 Thread Lars
Hi i got a problem with a listview,
how can i get to change the state when my listview item is selected (in the 
use of multipane view)
i only need to change that state the other states like pressed and things i 
like to keep default

Thanks

-- 
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

Re: [android-developers] Listview Selector

2012-09-12 Thread Kostya Vasilyev
Here is how I do it:


?xml version=1.0 encoding=utf-8?
selector xmlns:android=http://schemas.android.com/apk/res/android;

item android:drawable=@android:color/transparent
android:state_pressed=true/
item android:drawable=@android:color/transparent
android:state_selected=true/
item android:drawable=@color/message_list_read_background_light/

/selector

-- K

2012/9/12 Lars werkman.l...@gmail.com

 Hi i got a problem with a listview,
 how can i get to change the state when my listview item is selected (in
 the use of multipane view)
 i only need to change that state the other states like pressed and things
 i like to keep default

 Thanks

 --
 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

-- 
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

[android-developers] Listview selector no more color

2010-12-27 Thread Mystique
I just want the selector to be as default, when I select an item I see
color change. But when I change my xml the selector is no longer
working. Why is this so?
---
?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=fill_parent
android:background=@color/background
android:padding=10sp


TextView
android:id=@+id/list
android:layout_width=fill_parent
android:layout_height=fill_parent
android:singleLine=true
android:textAppearance=?android:attr/textColor
android:gravity=center_vertical|left
/TextView
/LinearLayout
---

Many thanks,
CJ

-- 
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


[android-developers] listview selector based on item-type

2010-11-03 Thread Johannes De Smedt
Hi,

In my application I have a list with 2 types of items. For the first
type I can use the default selector drawn behind the content, but for
the second type I would need another selector that is drawn in front
of the content.

Can this be done in android?

The reason why I need another selector, is because the second type is
an image that fills the whole cell. Therefore the default selector is
not visible. When I draw the selector in front of the image, the
images is not visible. Therefor I would like a transparent selector
for those items, and keeping the default one for the other ones.

Other suggestions are also welcome!

-- 
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


Re: [android-developers] listview selector based on item-type

2010-11-03 Thread Kumar Bibek
Yes you can. Look for examples where ListViews can show multiple view types.

On Wed, Nov 3, 2010 at 10:10 PM, Johannes De Smedt 
johannes.desm...@gmail.com wrote:

 Hi,

 In my application I have a list with 2 types of items. For the first
 type I can use the default selector drawn behind the content, but for
 the second type I would need another selector that is drawn in front
 of the content.

 Can this be done in android?

 The reason why I need another selector, is because the second type is
 an image that fills the whole cell. Therefore the default selector is
 not visible. When I draw the selector in front of the image, the
 images is not visible. Therefor I would like a transparent selector
 for those items, and keeping the default one for the other ones.

 Other suggestions are also welcome!

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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

Re: [android-developers] listview selector based on item-type

2010-11-03 Thread Kostya Vasilyev
Make the image slightly smaller than the list item size - in other words,
leave a margin for the standard selection.

Consistency in the UI is a good thing.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

03.11.2010 19:40 пользователь Johannes De Smedt 
johannes.desm...@gmail.com написал:

Hi,

In my application I have a list with 2 types of items. For the first
type I can use the default selector drawn behind the content, but for
the second type I would need another selector that is drawn in front
of the content.

Can this be done in android?

The reason why I need another selector, is because the second type is
an image that fills the whole cell. Therefore the default selector is
not visible. When I draw the selector in front of the image, the
images is not visible. Therefor I would like a transparent selector
for those items, and keeping the default one for the other ones.

Other suggestions are also welcome!

--
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.comandroid-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

-- 
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