在project/res目录下:
1.project\res\anim\ 特效zoom_in.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:Android="http://schemas.android.com/apk/res/android"
Android:interpolator="@android:anim/decelerate_interpolator">
<scale Android:fromXScale="2.0"
Android:toXScale="1.0"
Android:fromYScale="2.0"
Android:toYScale="1.0"
Android:pivotX="50%p"
Android:pivotY="50%p"
Android:duration="@android:integer/config_mediumAnimTime" />
</set>
2.project\res\color\ 指定颜色menu_color.xml (selector在多场景下使用,如选中,按下,获取焦点,松开)
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="#B6B8BA"/>
<item android:state_selected="false" android:color="#D0D3D7"/>
</selector>
3.project\res\drawable\ 放图片资源
4.project\res\layout\ 放布局文件
5.project\res\menu\ 菜单选项 home_menu.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/cloud_switch"
android:icon="@drawable/cloud_switch"
android:title="@string/cloud_switch"
android:orderInCategory="0" />
<item android:id="@+id/recommend"
android:icon="@drawable/recommend"
android:title="@string/recommend"
android:orderInCategory="1" />
</menu>
6.project\res\values\ 放字符串,主题,风格,属性,单颜色
colors.xml 颜色
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="grid_item_normal">#272728</color>
<color name="grid_item_pressed">#272728</color>
<color name="grid_item_selected">#272728</color>
<drawable name="chatdivider">#ffd6dadc</drawable>
</resources>
attrs.xml属性
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="AppGridView">
<attr
name="line_drawable"
format="reference" />
<attr
name="cell_number"
format="integer" />
</declare-styleable>
</resources>
strings.xml 字符串 使用 “@string/app_name”
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Hello world</string>
</resources>
数组items_icontext.xml 使用TypedArray mTexts=getResources().obtainTypedArray(R.array.icons)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="icons">
<item>@drawable/cloud_switch</item>
<item>@drawable/recommend</item>
</array>
<array name="texts">
<item>@string/cloud_switch</item>
<item>@string/recommend</item>
<item>@string/checknew</item>
</array>
</resources>
风格para_style.xml 使用的时候style="@style/titlebar_style"
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 窗体标题栏样式 TextView -->
<style name="titlebar_style">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">46dip</item>
<item name="android:gravity">center_vertical</item>
<item name="android:textColor">@color/titlebar_text</item>
<item name="android:textSize">17sp</item>
<item name="android:paddingLeft">14dip</item>
<item name="android:background">@drawable/titlebar_bg</item>
</style>
</resources>