AndroidStudioTemplates自定义模板

之前这样搞过,每次studio升级都会删掉我们自己写的模板,现在干脆放弃了这种方式

每个Activity模板,对应一个文件夹,对应我们创造Activity时,New Activity,

除了内置的几个模板,我们可以自己开发,当然github上也有部分开源的模板,只需要下载别人提供的模板文件,copy至as安装目录下:/plugins/android/lib/templates/activities

然后重启Android Studio即可。

可以参考的插件如下:

https://github.com/kanytu/Android-studio-material-template

A template for Android Studio to create applications with material design and Navigation Drawer.包含:MaterialNavigationDrawerActivity

https://github.com/MontazzeStudio/android-studio-template

包含DrawerWithTabsActivity和RecyclerRefreshActivity

https://github.com/gabrielemariotti/AndroidStudioTemplate

包含SwipeRefreshLayout,还有一些常用的模板。

除了Activity模板,还有些其他的模板,例如下面这个模板就很有意思:

https://github.com/intrications/material-design-icons-adt-template

用于创建Material Design Icon,可以非常方便的创建Icon,再也不需要自己去找下载各种尺寸了。

New–>Other–>Material Deaign Lcons,然后可以选择创建需要的Icon

当然上述这些开源项目理论上只是用于参考,不过讲道理我们应该自己去学习如何编写这样的模板,针对我们平时的需求去编写一些模板,提升开发效率。

我也给大家找了些模板开发的相关链接,大家可以参考下。

http://www.jianshu.com/p/81d03519dd33

https://www.zhihu.com/question/46979171

http://www.i-programmer.info/professional-programmer/resources-and-tools/6845-android-adt-template-format-document.html

https://developer.android.com/studio/projects/templates.html

http://robusttechhouse.com/tutorial-how-to-create-custom-android-code-templates/


https://github.com/WanAndroid/AndroidStudioTemplates

    原文作者:在你左右2018
    原文地址: https://www.jianshu.com/p/5144a1fab3ae
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞