💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[原文地址](http://androidwing.net/index.php/27) [GitHub地址](https://github.com/githubwing/MVPHelper) 详细更新操作可以参考上面的GitHub地址 作者对MVP的理解可以参考:[Android开发之初识MVP模式](http://blog.csdn.net/wingichoy/article/details/50893367) ### MVPHelper 一款Intellj IDEA 和Android Studio的插件,可以为MVP生成接口以及实现类,解放双手。 Github 地址 https://github.com/githubwing/MVPHelper ![image](https://github.com/githubwing/MVPHelper/raw/master/img/mvp_presenter.gif) #### **注意** 对于MVP模式,定义一个Contract类来放置Model View Presenter 的接口,将大大减少类文件。将普通的接口替代如下: ~~~ public interface GoodsInfoContract { public interface View{ } public interface Presenter{ } public interface Model{ } } ~~~ 当你在Contract类中使用插件,效果如下: ![](https://github.com/githubwing/MVPHelper/raw/master/img/mvp_contract.gif) #### **如何使用** 安装完插件后 在Contract类或者Presenter类内部,点击Generate菜单,选择MVPHelper即可生成对应文件 ![](https://github.com/githubwing/MVPHelper/raw/master/img/step1.png) ![](https://github.com/githubwing/MVPHelper/raw/master/img/step2.png) ### 参考文章: [Android 使用MVPHelper工具生成,MVPDemo模拟登录演示](http://blog.csdn.net/qq_35070105/article/details/69663298)