Look at the source code of VLC today and find a very magical thing
All ListView's Click effect Background color is orange color
It took some time to find out how to make it come true.
First, define a <selector>
Like this:
<selector>
<item android:state_pressed= "true" >
<shape android:shape= "Rectangle" >
<solid android:color= "@color/orange" >
</shape>
</item>
</selector>
Of course, you can also directly find a picture of orange, the effect is the same as above
Then you can build a style, which can contain all the properties of the ListView you want, just for example, so only one android:listselector is written.
<style name= "Theme.list" >
<item name= "Android:listselector" > @drawable/a picture or the selector corresponding XML, placed in the Drawable folder can ~ </item>
</style>
Put this style into a large theme definition, like this: (The Scarlet letter means inheritance, because we only modified a part of a large theme)
<style name= "theme.application" parent= "Theme.sherlock.Light" >
<item name= "Listviewstyle" > @style/theme.list</item>
</style>
Finally put this theme into your activity's android:theme so that all your activity's ListView (including fragment) is the style.
<activtiy
Android:theme= "@style/theme.application"
>