Android studio初始使用常用設定
工欲善其事必先利其器,Android studio是我們手機的工具,對工具的瞭解程度越深,就能越方便我們的開發,提高開發效率。每次新到一個公司,或者換一臺電腦,重灌一次系統,都要重新來配置Android studio的這些配置,有時候真的想不起來還差什麼,所以就乾脆記錄下來,往後直接對照著配置。
1.設定編輯介面和程式碼主題
我們可以根據我們喜好選擇我們想要的顏色,白色和黑色。
選擇"Preferences->Appearance->Theme",預設可以選擇Light和Darcula,分別為白色和黑色主題,選擇之後點選Apply應用。

白色主題

黑色主題
怎麼沒有你喜歡的顏色?那就選擇更多的主題。去 ofollow,noindex">Color Themes官網 下載各種主題的jar包。

螢幕快照 2018-11-17 上午10.44.40.png
選擇一款自己喜歡的,點選綠色框下載,下載的為.jar檔案

怎麼使用呢?"File->import Settings"匯入該jar檔案,選擇ok就ok啦,然後重啟AS。

然後程式碼裡就是逼格慢慢的程式碼主題啦。

2.修改字型大小和字型樣式
這個就是老生常談了,在"Preferences->Editor->Color Scheme->Color Scheme Font"下,先選擇一個Scheme主題,設定size然後Apply就好了。在Font下可以選擇各種字型。


3.設定檔案註釋模板
在"Preferences->Editor->File and Code Templates"下,切換到Includes下,在File Header裡面設定註釋模板。

新建立的檔案:
/** * create by apple * create on 18/11/17 * description */ public class CodeTemplate { }
可選的變數名有:
redefined variables will take the following values: ${PACKAGE_NAME} name of the package in which the new file is created ${USER} current user system login name ${DATE} current system date ${TIME} current system time ${YEAR} current year ${MONTH} current month ${MONTH_NAME_SHORT} first 3 letters of the current month name. Example: Jan, Feb, etc. ${MONTH_NAME_FULL} full name of the current month. Example: January, February, etc. ${DAY} current day of the month ${DAY_NAME_SHORT} first 3 letters of the current day name. Example: Mon, Tue, etc. ${DAY_NAME_FULL} full name of the current day. Example: Monday, Tuesday, etc. ${HOUR} current hour ${MINUTE} current minute ${PROJECT_NAME} the name of the current project
4.設定自動導包
在沒有設定自動導包的時候,匯入的包不會自動更新,設定之後廢棄的,未使用的導包會自動清除掉。在"Preferences->Editor->Auto Import"中,勾選上如下2條,就配置好自動導包了。
