还在繁琐的敲MVP接口和实现类吗,教你一秒搞定。

只有程序员懒起来,才能提高开发效率 233333

在MVP的使用过程中,我们需要反复的去写各种MVP的接口和实现类, 实在是 太麻烦了!!所以抽时间撸了一款插件(只可用于Intellj IDEA 和 Android Studio),用于生成MVP接口以及他的实现类,可以略微提升一点开发效率。

效果图如下:
这里写图片描述
转载请注明出处:http://blog.csdn.net/wingichoy/article/details/52020838

注意

对于MVP模式,定义一个Contract类来放置Model View Presenter 的接口,将大大减少类文件。将普通的接口替代如下:

public class GoodsInfoContract {

  public interface GoodsInfoView{

  }
  public interface GoodsInfoPresenter{

  }
  public interface GoodsInfoModel{

  }

}

如何使用

Step1

去github上下载jar包
https://github.com/githubwing/MVPHelper/

Step2

按照提示安装jar。

image

image

Step3

在Contract类内部,点击Generate菜单,选择MVPHelper即可生成对应文件

注意:Contract目前只能放在包 contract 中!

image

image

其实我是来骗star的。。 求star啊

https://github.com/githubwing/MVPHelper/

如果你喜欢我的博客 ,请关注和评论我,蟹蟹!

posted on 2016-07-25 09:46  木鱼哥  阅读(244)  评论(0编辑  收藏  举报

导航