MvpAutoCodePlus

Compatible with: IntelliJ IDEA Android Studio
Feb 22, 2019
1 984

MvpAutoCodePlus


Website | GitHub | Issues | Blog


An plugin that automatically generates an MVP template code.


Features:

  • Automatically generate Contract Interface based on the specified super Interface.
  • Automatically generate implements class based on the Contract Interface and specified superclass.Add the default implementation of the abstract method.
  • Supports generics(currently only have M,V,P).
  • Supports Java and Kotlin.


Send feedback

Recent change notes

Fix bug,support custom super interface name. Thank you klxy1990 for your feedback.


Full Changelog History

General usage instructions

1. 配置父接口: 点击Preferences(Settings) > Other Settings > MvpAutoCodePlus 添加父接口和父类信息. 2. 生成: - 右击要生成的目标包,New > Generate Mvp Code (或选中包,按Alt+Insert),生成contract包后可以选中contract包或contract的父包. - 输入生成的代码主名,比如要做Login功能,就输入Login,生成是ILoginContract,LoginActivity,LoginPresenter,LoginModel - 选择代码实现方式,可选Java或Kotlin - 选择View的实现方式,Activity或Fragment,如果配置了多个的话,可选择其中之一,不想生成的项去掉前面的复选框.(如果使用了泛型的话,会导致其他类中该类找不到的问题,比如P的实现类中有泛型M,但是没有勾选生成M的实现类,P的实现类中就会找不到) - 点击Ok,稍等一会儿,代码就生成了. 1. Configure the parent interface: Click Preferences(Settings) > Other Settings > MvpAutoCodePlus to add super interface and super class information. 2. Generate: - right-click the target package to Generate,New > Generate Mvp Code (or select the package, press Alt+Insert), and after generating the contract package, you can select the parent package of the contract package or contract. - enter the code generated by the name, such as do the Login function, enter the Login and generation is ILoginContract, LoginActivity, LoginPresenter, LoginModel - choose the code implementation, Java or Kotlin - choose to View the realization way of the Activity or fragments, if configured with multiple, can choose one of them, don't want to remove the check box in front of the item generated. (if you use the generic, can lead to other classes of the class to find problems, such as the realization of the P with generic M in class, but did not check the generation M's implementation class, P implementation class will find) - click Ok, wait a moment, the code is generated.