preface
In the previous article, I introduced KtArmor’s simple LoginDemo example. One login function, we need to create four classes, too cumbersome. There’s no easier way. It must! The KtArmor framework also has a ktarMOR-MVP plug-in to help developers quickly generate the corresponding template code (Activity, Presenter, Model, Contract).
The plugin demo
Plug-in download
Plug-in download
Ktarmor-plugin, uploaded to IDEA platform, is still under review. Approved. Install the plugin on update AndroidStudio
Local Jar installation
- 1. After downloading the KtarMOR-MVP plug-in JAR package
- 2. Open AndroidStudio
- 3
File->Settings->Plugins
Select the one you just downloadedThe jar plug-in
- 4, then restart the AndroidStudio to use ~
Through local installation, the subsequent plug-in update may be troublesome. AndroidStudio Plugin is recommended to download and install.
Recommended installation
- 1. Open AndroidStudio
- 2,
File->Settings->Plugins
, search plug-inKtArmor-MVP
Then click Download install - 3, then restart AndroidStudio to use.
If you download and install it from AndroidStudio, you can update it directly without downloading Jar packages. Recommended.
The plug-in USES
Since the plug-in is automatically generated, some developer information templates can be configured here. The header of the following file automatically generates the corresponding developer information. Here I changed it to: @author: HyZhan
Then right-click in any directory and select Generate MVP Code as you would create a Java class. Fill in the Module name to Generate the corresponding file. For example, if you enter module name as Register, a Register (lowercase) directory will be created under the currently selected directory:
- RegisterContract
- RegisterActivity
- RegisterPresenter
- RegisterModel
- activity_register
Activity
Registered toAndroidManifest.xml
As shown below
The last
This is KtArmor’s second article. Plug-in is in accordance with my own development habits to develop, the final actual use of the effect, or quite satisfactory. I hope you enjoy it. (low low ◡) ~
To tell the truth, plug-in development is very headache, the data on the net is relatively few, step on pit all the way come over, plug-in if have wrong, hope everybody big guy points out. Welcome everyone pr trade, exchange and study together.
Kotlin’s Magical Mecha — KtArmor (PART 1)
Kotlin’s Magical Mecha — KtArmor (Part 3)
Ktarmor-mvp source code portal
See you next time