美文网首页
Android Studio使用技巧

Android Studio使用技巧

作者: Xiangdong_She | 来源:发表于2016-12-13 22:03 被阅读38次

一、视觉

  1. 更改Logcat的颜色
    路径:File->Settings(Ctrl+Alt+S)->Editor->Colors&Fonts->Android Logcat.
    配置
  • Assert-->#9B9CC8
  • Debug -->#2196F3
  • Error-->#F42330
  • Info-->#2DAF36
  • Verbose-->#A6AEBB
  • Warning-->#FF9E00

二、安装实用插件

  1. Android Material Design Icon Generator Plugin

官网Android Material Design Icon Generator Plugin
用途:为工程添加Material Design图标
安装(手动)

  1. 下载,就点我
  2. File -> Settings-> Plugins -> Install plugin from disk...选择下载好的MaterialDesignIconGeneratorPlugin.zip安装包,然后ok。
  3. 重启Android Studio。

用法:右键项目-->选择New-->选择Material Icon Generator-->然后查找自己想要的图标-->生成。

Material Design Icon.png
0102.png

2.ButterKnifeZelezny

官网ButterKnifeZelezny
用途:一键从 布局文件中 生成对于的 View 声明和 ButterKnife 注解
安装(手动)

  1. 没错,戳我下载
  2. File -> Settings-> Plugins -> Install plugin from disk...选择下载好的android-butterknife-zelezny.jar包,然后ok,
  3. 重启Android Studio。

用法

  1. 确保自己项目中有最新版Butterknife的依赖
  2. 在Activity或者Fragment中找到布局文件(eg. R.layout.main),然后在在main上右键,选择Generate-->Generate ButterKnife Injections.
  3. 选择自己想要注入的内容,也可以为adapters创建ViewHolder。
  4. 点击Confirm进行注入


    ButterKnifeZelezny.png
    ButterKnifeZelezny.png

3.GsonFormat

官网GsonFormat
用途:根据JSONObject格式的字符串,自动生成实体类参数.>安装(手动)

  1. 点我下载
  2. File -> Settings-> Plugins -> Install plugin from disk...选择下载好的GsonFormat.zip文件,然后ok。
  3. 重启Android Studio。

用法

  1. 使用Generate的快捷键(alt+insert).或者(alt+s)
  2. 在对话框中贴入JSON字符串,之后format,点击OK.


    GsonFormat1.png
    GsonFormat2.png
    GsonFormat3.png
    GsonFormat4.png

4.Android Methods Count

官网Android Methods Count
用途:显示依赖库中的方法数
安装(手动)

  1. 点我下载
  2. File -> Settings-> Plugins -> Install plugin from disk...选择下载好的MethodsCountIdeaPlugin.zip文件,然后ok。
  3. 重启Android Studio。

用法
如下图,可以直接在dependencies中看到信息

0401.gif
0402.png

相关文章

网友评论

      本文标题:Android Studio使用技巧

      本文链接:https://www.haomeiwen.com/subject/cfhspttx.html