MVP prevalence, the most complaints heard is how to write so many interfaces, then the author provides a plug-in, the automatic generation of these interfaces declaration. Interested can also learn the plug-in writing, according to their usual needs to modify, to provide development efficiency.
Mvphelper
A plugin for Intellj idea and Android studio that can create interfaces for MVP and implement classes, freeing hands.
Github Address:
Attention
For MVP mode, defining a contract class to place the model View Presenter interface greatly reduces the class file.
Replace the normal interface with the following:
1 Public InterfaceGoodsinfocontract {2 3 Public Interfaceview{4 5 }6 Public Interfacepresenter{7 8 }9 Public Interfacemodel{Ten One } A -}
When you use plugins in the contract class, the effect is as follows:
How to use
Search Mvphelper in the plugin repository
method of manual installation;
Download Mvphelper.jar
(Https://github.com/githubwing/MVPHelper/raw/master/MVPHelper.jar)
Then install the plugin:
Inside the contract class or presenter class, click the Generate menu and select Mvphelper to generate the corresponding file.
Android Studio Plugin Mvphelper, one click to generate MVP code