Android Studio
全關(guān)鍵字型
1.fbc:findViewById()
2.const/key/psf:private static final int/String ...
3.fori/5.for:for循環(huán)
4.sout:System.out.println("...");
5.ifn/inn:if(... == null) {...}
6.gone:xxx.setVisibility(View.GONE)
7.rouiT:getActivity().runOnUiThread(...);
8.Sfmt:String.format("...","...");
9.ViewConstructors:自定義View構(gòu)造函數(shù)
后綴關(guān)鍵型
1..null/.notnull:xxx.null <==> if(xxx == null) {...}
2..var:xxx.var<==>XXX ?Xx = (XXX) xxx;?
3..field:變成成員變量
4..for/.fori/.forr:for循環(huán)
5..return/.if:xxx.return<==>return xxx; ? ?x==1.if<==>if(x==1){...}
6..cast:xxx.cast<==>((XXX)xxx)
7..try:xxx.try<==>try{...}catch(...){...}
8..format:格式化
9..switch:xxx.switch<==>switch(xxx){...}
修改方式:File >> Settings >> Keymap
Eclipse
1.alt+/:代碼提示
2.ctrl+shift+O:自動(dòng)導(dǎo)包或刪除無用包
3.ctrl+shift+F:自動(dòng)對齊(易與輸入法沖突)
4.ctrl+/:注釋當(dāng)前行
5.ctrl+alt+/:注釋代碼塊
6.ctrl+d:刪除當(dāng)前行
7.ctrl+shift+R:打開資源文件
8.ctrl+O:outline視圖
9.ctrl+E:轉(zhuǎn)換編輯器
10.ctrl+Page Up/Page Down:轉(zhuǎn)換前后編輯文件
11.ctrl+shift+enter:當(dāng)前行上邊新建空白行
12.alt+上下箭頭:當(dāng)前行代碼上下移動(dòng)
13.ctrl+alt+上下箭頭:復(fù)制當(dāng)前行代碼到上/下邊
14.ctrl+M:當(dāng)前窗口最大化
15.ctrl+shift+X/Y:字母轉(zhuǎn)大/小寫
修改方式:Window >> Preferences >> General >> keys