Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

?android:attr/selectableItemBackground

when writing my android app i used

android:background="?android:attr/selectableItemBackground"

I tried looking for attr.xml file that would be containing the source but i could not find it. Any ideas please on where i can find it. I found one attr.xml in

C:\Program Files (x86)\Android\android-sdk\platforms\android-13\data\res\values

but it did not have the attribute mentioned above. Can anyone lead me where I can find the xml resource with the attribute above?

like image 873
Maxwell Weru Avatar asked Jun 10 '12 16:06

Maxwell Weru


People also ask

What is ATTR selectableItemBackground?

attr/something means "use the value of the attribute named {something} that was defined for the current theme". selectableItemBackground is the name of an attribute in your app's theme (usually in styles.

What is ripple effect in Android?

The touch feedback in Android is a must whenever the user clicks on the item or button ripple effect when clicking on the same, gives confidence to the user that the button has been clicked so that they can wait for the next interaction of the app.


1 Answers

I'm not that experienced with Android, but I think you can find what you're looking for in "data\res\values\themes.xml".

If you search in that file for "selectableItemBackground", you should find the following:

<style name="Theme">
...
        <item name="selectableItemBackground">@android:drawable/item_background</item>
...
</style>

You'll also find respective entries for Theme.Holo.Light and Theme.Holo. The *"item_background"*, *"item_background_holo_light"*, and *"item_background_holo_dark"* drawables would be located in the "data\res\drawable" folder.

Hope that helps!

like image 119
Gautam Avatar answered Nov 15 '22 15:11

Gautam