eclipse转androidstudio时as的配置

来源:互联网 发布:店铺淘宝客sina 编辑:程序博客网 时间:2024/05/18 03:08

前言:

    以前用惯了eclipse觉得别人都用as,觉得as这也不好,那也不行。比如运行卡,快捷键用不习惯,没eclipse的有些代码提示,快速修正什么的,后面查了资料把as配置成eclise类似的快捷键后觉得还是as用起来舒服,as虽然开始运行起来卡,但是运行稳定之后就好了,不会像eclipse那样老是提示adb掉了什么的,又要重启,很麻烦,而且代码提示功能只要自己设置好了跟eclipse用起来差不多,最方便的还是代码提醒功能,不用像eclipse老是去alt+/去提示代码,而是输入相关api的首字符就可以提示出来,而且布局中也是自动补全,很方便。总的来说用惯了as后就会觉得确实比eclipse好用。

以下为个人当初eclipse转as时的一些配置:

1.设置as与eclipse功能类似的快捷键:

1.1设置鼠标移动到代码上面时悬浮提示:Settings(扳手图标)-Editor-General-other-show quick doc on mouse move 打钩

1.2设置显示的主题风格:Settings(扳手图标)-Appearance -Theme-Darcula 默认的黑色;IntelliJ和windows都为白色
1.3设置快捷键与eclipse大部分一样:Settings(扳手图标)-Appearance -Keymap-下来选择eclipse copy
1.4设置代码提示功能(不区分大小写):Settings-Editor-General-Code Completion 右侧Case sensitive ...设置为none

1.5设置注释代码快捷键:Settings(扳手图标)-Appearance -Keymap-搜索comment-找到对应的地方设置相应的快捷键;即搜索里面输入comm找到commnet with line comment即设置注释的快捷键,双击选择添加快捷键,然后设置ctrl+shift+c,之后弹出确定是否移除重复的快捷键,确定;搜索输入comp找到completion下面的smarttype设置代码提示快捷键alt+/

1.6其他快捷键:alt +enter 为自动导包/快速修正,需放在错误提示的控件的后面,不像eclipse在这一行也能修正;alt +ctrl + space 提示补全匿名内部类;Alt+Insert  生成构造/set/get方法;ctrl+shift+alt+s弹出导jar包module的structure

2.弹出DDMS:Tools-Android-Android Device Monitor

3.设置代码块:Settings-Editor-Live Templates-点击右侧加号.添加后记得defin为java,然后apply,然后点击ok即可使用。其中Abbreviation里面设置自己喜好的提示简写字符。右边那个描述可加可不加,下面的空白地方设置代码提示模块,然后一个个加,加完后define为java,然后apply

Log.i(TAG, "");

private static final String TAG = "TAG";
private static final boolean DEBUG = true;
tv=(TextView)findViewById(R.id.tv);
bt=(Button)findViewById(R.id.bt);
toggleButton=(ToggleButton)findViewById(R.id.toggleButton);
et=(EditText)findViewById(R.id.editText);
gridView=(GridView)findViewById(R.id.gridView);
listView=(ListView)findViewById(R.id.listView);
imageView=(ImageView)findViewById(R.id.imageView);
imageButton=(ImageButton)findViewById(R.id.imageButton);
seekBar=(SeekBar)findViewById(R.id.seekBar);
progressBar=(ProgressBar)findViewById(R.id.progressBar);
spinner=(Spinner)findViewById(R.id.spinner);
webView=(WebView)findViewById(R.id.webView);
rg=(RadioGroup)findViewById(R.id.rg);
rl=(RelativeLayout)findViewById(R.id.rl);
ll=(LinearLayout)findViewById(R.id.ll);
fl=(FrameLayout)findViewById(R.id.fl);
sv= (ScrollView)findViewById(R.id.scrollView);
Toast.makeText(mContext,"",Toast.LENGTH_SHORT).show();
switch (view.getId()){
    case R.id.:


        break;
    default:
        break;
}
Thread.currentThread().getId();
try {
    
}catch (Exception e){
    e.printStackTrace();
}

0 0