美文网首页
AS不为人知的使用技巧

AS不为人知的使用技巧

作者: 34sir | 来源:发表于2018-02-23 18:27 被阅读11次

插件

  • Android Parcelable code generator插件
    使用
    新建实体类:
public class TestEntity {
    int test1;
    String test2;
}

右键Generate,选择Parceable,点击OK:

public class TestEntity implements Parcelable {
    int test1;
    String test2;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.test1);
        dest.writeString(this.test2);
    }

    public TestEntity() {
    }

    protected TestEntity(Parcel in) {
        this.test1 = in.readInt();
        this.test2 = in.readString();
    }

    public static final Parcelable.Creator<TestEntity> CREATOR = new Parcelable.Creator<TestEntity>() {
        @Override
        public TestEntity createFromParcel(Parcel source) {
            return new TestEntity(source);
        }

        @Override
        public TestEntity[] newArray(int size) {
            return new TestEntity[size];
        }
    };
}
  • ECTranslation插件
    作用:翻译英文注释
    使用:
    去github,ECTranslation,获取 ECTranslation.jar
    选择File ->Settings ->Plugins->Install plugin from disk -> 选择 ECTranslation1.5.jar
    选择需要翻译的单词,右键translate

    翻译.png
  • eventbus3-intellij-plugin插件
    作用:快速查找eventbus发送和使用的地方,目前只支持eventbus3.0

  • ButterKnife Zelezny
    作用:自动绑定控件

    ButterKnife Zelezny.gif
  • InnerBuilder
    作用:自动生成builder模式代码

    InnerBuilder.gif
  • ADB Idea
    作用:提高调试效率
    如图:

    ADB Idea.png

Chrome插件

  • Octotree
    作用:Chrome针对github的插件,可以直接将git上的项目结构读取到屏幕左边,节省查看代码的时间
  • JsonView
    作用:json格式的数据在网页上面就可以直接json格式
  • Postman
    作用:可以用来调用接口,支持参数传文件,传json各种格式都可以

非插件

  • 布局文件抽取style:
    使用:光标位于目标控件中 - 右键 - Refactor - Extract - Style

  • 多个窗口
    作用:同一个文件还可以打开两个窗口,查看不同的代码块
    如图:

    多窗口.png
  • Annotate
    标注每一行是git哪个用户那个版本什么时候提交的
    使用:右击每一行左边空白处:

    Annotate.png
  • 代码分析
    lint:


    lint.png
  • 修改方法名称
    修改一处,使用处全部修改
    使用:双击方法,右击:

    change method.png
  • debug
    可见debug使用技巧

相关文章

网友评论

      本文标题:AS不为人知的使用技巧

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