題注:Android Studio的體驗(yàn)性確實(shí)要比Eclipse上的效率高甜癞,下面的幾點(diǎn)小配置可能對(duì)你的代碼規(guī)范起到一點(diǎn)小小的作用
導(dǎo)讀
- 添加文件描述
- 添加方法注釋
- logcat配置
添加文件描述
step1: 點(diǎn)擊 setting>>Editor>>File and code Templates
step2: 選中includes標(biāo)簽
step3: 點(diǎn)擊File Header
step4: 在右邊輸入框輸入以下內(nèi)容
/**
* author: ${USER}
* created on: ${DATE} ${TIME}
* description:
*/
添加方法注釋
step1: 點(diǎn)擊 setting>>Editor>>File and code Templates
step2: 選中includes標(biāo)簽
step3: 點(diǎn)擊綠色的”+”新建一個(gè)名為”Method Header”的子元素
step4: 選中新建的”Method Header”境氢,在右邊輸入框輸入以下內(nèi)容昼激,點(diǎn)擊OK
/**
* description: <一句話功能簡(jiǎn)述>
* @param [參數(shù)1] [參數(shù)1說(shuō)明]
* @param [參數(shù)2] [參數(shù)2說(shuō)明]
* @return [返回類(lèi)型說(shuō)明]
* @exception/throws [違例類(lèi)型] [違例說(shuō)明]
* @see [類(lèi)本慕、類(lèi)#方法辨图、類(lèi)#成員]
*/
step5: settings>>keymap>>Other>>fix doc comment
step6:右擊fix doc comment 選擇 Add Keyboard shortcut
step7:按下自己喜歡的快捷鍵,點(diǎn)擊OK童番,再點(diǎn)擊OK
Logcat配置
File->Settings 或Ctrl + Alt +S 找到 Editor -> Colors &Fonts -> Android Logcat 或在上面的搜索框中輸入Logcat 點(diǎn)中Verbose , Info, Debug等選項(xiàng)崩瓤,然后在后面將Use Inberited attributes 去掉勾選 再將 Foreground 前的復(fù)選框選上伪货,就可以雙擊后面的框框去選擇顏色了 Apply–>OK
Log級(jí)別色值
VERBOSE BBBBBB
DEBUG 0070BB
INFO 48BB31
WARN BBBB23
ERROR FF0006
ASSERT 8F0005