1. 程式人生 > >Android Studio中我都用了哪些外掛

Android Studio中我都用了哪些外掛

● 1、ECTranslation

介紹:翻譯外掛,可以將英文翻譯為中文,中文翻譯為英文

使用:右鍵—Translate

image

結果:英文—中文

image

結果:中文—英文

image

● 2、Android ButterKnife Zelezny

介紹:輔助butterknife生成註解,從此不用寫findViewById,在Activity,Fragment,Adapter中選中佈局xml的資源id自動生成butterknife註解。

前提:引入butterknife包 compile ‘com.jakewharton:butterknife:8.5.1’

使用:在layout檔案使用之處,右鍵Generate/Alt+Insert—生成Butterknife注入

image

結果:

image

● 3、GsonFormat

介紹:快速將json字串轉換成JavaBean,免去根據json字串手寫對應JavaBean的過程。

使用:在javabean class檔案裡,右鍵Generate/Alt+Insert—GsonFormat

image

再把json字串拷貝進去,點選ok自行調整後確定生成

image

結果:

image

● 4、Android Parcelable code generator

介紹:一款可以生成實現Parcelable介面的程式碼的外掛

使用:在javabean class檔案裡,右鍵Generate/Alt+Insert—Parcelable

image

結果:

image

● 5、Android Studio Prettify

介紹:可以將程式碼中的字串寫在string.xml檔案中

使用:選中字串,右鍵—Extract String resource

image

為string資原始檔取名

image

結果:

image

● 6、Android Styler

介紹:根據xml自動生成style程式碼的外掛

使用:從layout檔案中拷貝需要抽取為style的多行屬性

image

進入Style.xml中,在要建立style的位置,按下快捷鍵Ctrl+Shift+D

image

結果:

image

● 7、AndroidProguard Pro

介紹:一鍵生成專案混淆程式碼外掛,值得你安裝~(不過目前可能有些第三方專案的混淆還未新增完全)

使用:

image

結果:

image

● 8、Material Theme UI

介紹:新增Material主題到你的AS

使用:外掛安裝完,apply

image

結果:

image

● 9、.ignore

介紹:我 們都知道在Git中想要過濾掉一些不想提交的檔案,可以把相應的檔案新增到.gitignore 中, 而.gitignore 這個Android Studio 外掛根據不同的語言來選擇模板,就不用自己在費事新增一些檔案了,而且還有自動補全功能,過濾檔案再也不要複製檔名了。我們做專案的時候,並不是所有文 件都是要提交的,比如構建的build 資料夾,本地配置檔案,每個Module 生成的iml 檔案,但是我們每次add,commit 都會不小心把它們新增上去,而gitignore 就是解決這種痛點的,如果你不想提交的檔案,就可以在建立專案的時候將這個檔案中新增即可,將一些通用的東西遮蔽掉。

使用:選中Project/Module—右鍵New—.ignire file—Git

image

我的是Android專案,所以語言/框架選擇Android

image

結果:自己去掉了空格和註釋

image

● 10、Android Code Generator

介紹:根據佈局檔案快速生成對應的Activity,Fragment,Adapter,Menu。

使用:在layout佈局檔案中,右鍵—Generate Android Code—選擇生成對應的檔案

結果:

image

● 11、DimenHelper

介紹:Android Studio自動生成dimen.xml檔案外掛

使用:選擇預設的dimen檔案,右鍵—生成dimen

image

按需新增

image

結果:

image

● 12、PermissionsDispatcher plugin

介紹:自動生成6.0許可權的程式碼,前提是引入github:PermissionsDispatcher plugin

image

使用:

image

結果:

image

參考: