在我们进行Android 软件开发的时候一般总会有很多软件的页面和我们之前做过的页面和像,这时候我们如果能弄几个Activity 模板简直是很幸福很幸福的一件事了,废话不多说看效果图。
这个就是我引入的模板,一行代码都没改,极大的减少了部分代码的编写,下面说说具体的做法。
要想显示上面那种自定义的模板首先我们就需要有模板,收集一些常用的模板就很重要了。。我先列举出来几个:
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,还有一些常用的模板。https://github.com/intrications/material-design-icons-adt-template //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/
我们在下载了模板之后可以把下载后的模板放到{Android Studio installation dir}\plugins\android\lib\templates\activities\之后重启AndroidStudio 在新建Activity就会在模板页看到我们添加的模板已经出现了,选中即可。。。