ref:http://blog.csdn.net/gulianchao/article/details/23391651
(i) Layout naming
1. Contentview Name: activity_ function module. xml
For example: Activity_main.xml, Activity_more.xml
2. Dialog name: Dialog_ description. xml
Example: Dlg_hint.xml
2. Popupwindow Name: ppw_ description. xml
Example: PPW _info.xml
- List item naming listitem_ description. xml
Example: Listitem_city.xml
4. Contains items: Include_ module. xml
For example: Include_head.xml, Include_bottom.xml
(ii) Image naming
静态图片前缀_模块、前缀_模块_描述
For example: Bg_main.png, Ic_main_search.png
动态图片前缀_模块_描述_状态、前缀_描述_状态 例如:btn_film_buy_n.png、btn_film_buy_p.png、btn_back_n.png 如果有多种形态如按钮等除外如btn_film_buy.xml(selector)
(c) ID name (to be adjusted?? )
The name of the ID in the XML, it is suggested to be named directly by meaning, without using the above complex positioning, because Findviewbyid only find in a specified layout. or value to establish the unified management of ID files (compatibility is not good)
Original author used: Android: id= "@id/tv_name" Android (id= "at Id/tv_name" Android) : id= "@id/listv" (id= "at id/li STV ") , Android: id=" @id/tv_head_title (id= "at Id/tv_head_title) "
Personal usage: android: id= "@id/tvname" Android (id= "at Id/tvname" Android) : id= "@id/listvname" (id= "at ID/ Listvname ") , Android: id=" @id/tvheadtitle "(id=" at Id/tvheadtitle ") , and then the name and ID names in class remain the same
(iv) string naming
Better not with title, dialog, button and other things related, directly with the same English meaning can be, if the following:
Are you sure
Welcome to use
To cite some bad examples, determine the following
(v) Control naming
Control abbreviation _ Description
For example: Textviewtv_name, Button btn_buy, linearlayoutllyt_body;
(vi) class naming
Function module Activity.class function Module Service.class
such as: Mainactivity.class HuaFuBaoActivity.classAppUpgradeService.class
Resource abbreviation Description