Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Where to store Selector (xml) file for customed design controls

Tags:

java

android

I tried to make a custom LinearLayout and Button styles.

I'm just wondering where to place my Selector xml files?

<selector     xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape>
        <gradient 
            android:angle="90"  
            android:startColor="#534E4E"
            android:endColor="#000000"
            android:type="linear" />

    </shape>
</item>

In my mono project I put the files at drawable folder BUT in my Java(native) development I don't know maybe I miss the basic in storing files but still have no Idea where to put my Selector since the latest Eclipse plugin has 4 drawables (-ldpi,-hdpi, mdpi and xhdpi).

like image 445
Raf Avatar asked Oct 03 '12 13:10

Raf


People also ask

Where is values XML file in Android Studio?

Deciphering the Styles file Fire up Android Studio and search for values. xml and select the one contained inside the appcompat-support library.

What is selector in Android XML?

A selector can be an xml file created inside the drawable folder. Selector for different background colors. The following selector file btn_bg_selector. xml contains the code for setting different background colors on a button for different states.

How do I create an XML file in a drawable folder?

Right Click on Drawable folder -> New -> Drawable Resource File , will create a XML file inside the Drawable folder.

Where is res folder in Android Studio?

Select layouts , right-click and select New → Folder → Res Folder. This resource folder will represent a “feature category” that you want. You can easily create any type of file/folder in Android Studio.


1 Answers

Create a drawable/ folder in the res/ directory and add the selector.xml files in there.

like image 168
Rajeev N B Avatar answered Sep 28 '22 02:09

Rajeev N B