Can someone tell me the corresponding color code of a selected list item in Holo? Also, what are the colors to generate a long press list item transition in Holo? I know the Holo colors are defined in colors.xml but I'm unsure which ones are used for the selection and long press list item transition. Thanks in advance.
If you have a look at Android's platform framework base, especially the themes.xml
file, you will find the answer to your question:
https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/themes.xml
This file defines, amongst others, the following two Holo themes and its corresponding items:
Theme.Holo:
<style name="Theme.Holo">
...
<item name="colorPressedHighlight">@color/holo_blue_light</item>
<item name="colorLongPressedHighlight">@color/holo_blue_bright</item>
...
</style>
Theme.Holo.Light:
<style name="Theme.Holo.Light" parent="Theme.Light">
...
<item name="colorPressedHighlight">@color/holo_blue_light</item>
<item name="colorLongPressedHighlight">@color/holo_blue_bright</item>
...
</style>
I think these are the two colours you are looking for.
The colours are translated into the following hex codes:
<!-- A light Holo shade of blue -->
<color name="holo_blue_light">#ff33b5e5</color>
<!-- A really bright Holo shade of blue -->
<color name="holo_blue_bright">#ff00ddff</color>
You could try this :
android:background="?android:attr/selectableItemBackground"
You could also refer to
How do you get the selection color in Android?
and
Default selector background in Clickable Views
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With