2015年12月9日 星期三

Android 開發(一百零七) Android Studio 2.0 hotkey 筆記



 .settext -> .setColor  可以用tab不要用enter


Bitmap b =  null;
想要看更多可能的提示  control + shift + space 可能可以看到更多有用的提示


alt + or   可以協助選取


alt + enter 可以將constructor直接建立field 並且sign




也可以直接將instanceof 直接轉型




fori =>  live template
list.fori  => for(int i = 0; i< list.size() ; i++)

logi => Log.i(TAG, "liveTemplate: 123");
lost => private static final String TAG = "MainActivity";
MainActivity 是依照class name

logm =>  method 參數印log 

public void send(String p1, String p2){
    Log.d(TAG, "send() called with: " + "p1 = [" + p1 + "], p2 = [" + p2 + "]");
}

logr => return value 印出來
wtf => Log.wtf(TAG,"msg",new Exception);

command + shift + A => action name 快捷鍵提示視窗
選擇 replace structure  可以使用regex架構的 replace

shrinkResource = true
可以減少resource的數量,但是會減慢app的build速度

其他快捷鍵
Find symbol: OPT+CMD+O
Find Commands : Shift + CMD + A
View implementation of symbol: CMD+B
View implementation : OPT+CMD+B
recently used files: CRT+TAB


debug:
Evaluate 快速debug



condition debug break 例如recycler view你不會想針對每個一個一個看,你只會想要看某一個的時候,例如可以針對position==3
condition debug -> more info 可以做到增加log
可以直接在debug - >  console裡面看到,記得要將Suspend的勾勾取消選取



沒有留言:

張貼留言