开发神器-Android Studio插件

本文介绍了一系列提高Android开发效率的插件,包括ButterknifePlugin、Gsonformat、JsonOnlineViewer等。详细解释了这些插件的功能和使用方法,如ButterknifePlugin简化了组件绑定,Gsonformat用于快速生成Java实体类,JsonOnlineViewer则提供了在AndroidStudio中调试接口数据的功能。同时,还介绍了SelectorChapek和AndroidCodeGenerator这两个解决特定开发问题的插件,旨在提升开发体验。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、android-butterknife-zelezny

android-butterknife-zelezny 是根据butterknife定制的一款插件,能够方便快速初始化,对于我来说是开发必备,本人也对此插件进行了一些优化,个人感觉用起来更爽 ,博客地址: ButterknifePlugin

2、Gsonformat

可根据json数据快速生成java实体类

简单实体类

复杂实体类

3、JsonOnlineViewer

可实现直接在android studio中调试接口数据,可以选择请求类型,自定义请求头及请求体,json数据格式化后展示,配合着Gsonformat会不会不错呢?


4、SelectorChapek

设计师给我们提供好了各种资源,每个按钮都要写一个selector是不是很麻烦?这么这个插件就为解决这个问题而生,你只需要做的是告诉设计师们按照规范命名就好了,其他一键搞定。按照不同状态(normal、pressed)的标准命名后,右键文件树Generate Android Selectors

具体参考:http://blog.youkuaiyun.com/weifei554287925/article/details/41727541


2. AndroidCodeGenerator

它的介绍说是可以生成ViewHolder和findView方法的代码。不过怎么生成findView方法的代码我还没找到,但生成ViewHolder也是挺酷炫的。

在你的Adapter实现类的getView当中,将光标定位到你的布局文件的ID的变量中,按Alt+Insert插件代码,可以看到多了一项Create view holder,如下图。

选择它之后,它会根据布局文件里的声明了id的元素,为你生成对应的ViewHolder代码,如下所示:

[java]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. public class ViewHolder {  
  2.     public final TextView time;  
  3.     public final ImageView isnew;  
  4.     public final TextView username;  
  5.     public final TextView department;  
  6.     public final ImageView enter;  
  7.     public final CircleImageView avatar;  
  8.     public final RelativeLayout listcontent;  
  9.     public final View root;  
  10.   
  11.     public ViewHolder(View root) {  
  12.         time = (TextView) root.findViewById(R.id.time);  
  13.         isnew = (ImageView) root.findViewById(R.id.is_new);  
  14.         username = (TextView) root.findViewById(R.id.username);  
  15.         department = (TextView) root.findViewById(R.id.department);  
  16.         enter = (ImageView) root.findViewById(R.id.enter);  
  17.         avatar = (CircleImageView) root.findViewById(R.id.avatar);  
  18.         listcontent = (RelativeLayout) root.findViewById(R.id.list_content);  
  19.         this.root = root;  
  20.     }  
  21. }  




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值