当前位置:网站首页>An auxiliary MVP architecture project quick development library -mvpfastdagger
An auxiliary MVP architecture project quick development library -mvpfastdagger
2022-06-25 09:51:00 【seevc】
Share a MVP Architecture development , It can help to generate corresponding mvp Open source library of files , You don't have to create it manually model、view、presenter、module、component The file , Improve development efficiency . Source code address :MvpFastDagger
MvpFastDagger
MVP+Dagger+Annotation Rapid generation of project architecture mvp Corresponding documents .
MVP+Dagger+Annotation Every new one in the architecture Activity or Fragment All need to be added XXPresenter、IXXview、IXXModel、XXModleImp、XXModule、XXComponent class , Adding manually is tedious , This library can help us quickly generate mvp Corresponding documents .
notes : This open source library is applicable to MVP+Dagger+Annotation Architecture projects . Need to be introduced into the project Dagger and Annotation These two open source libraries .
MvpFastDagger It only takes one step to use
When using this annotation , You need to create Activity class , And then use @MvpFastDagger.
How annotations are used :
/**
* name Corresponding to the name of the class to be created
* basePresenterClazz It needs to be created presenter The parent of a class ,
* iBaseViewClazz Is to create view The parent of a class ,
* iBaseModelClazz Is to create model The parent class of the interface class ,
* baseModelImpClazz Is to be generated ModelImp Parent class of ,
* scopeClazz Corresponding Imodel Iview Life cycle of ,
* modules Corresponding Dagger in @Component In the annotations modules Field ,
* dependencies It's corresponding to @Component In the annotations dependencies Field , This field is optional
*/
@MvpFastDagger(name = "login",
basePresenterClazz = BasePresenter.class,
iBaseViewClazz = IViewAdvance.class,
iBaseModelClazz = IModel.class,
baseModelImpClazz = BaseModel.class,
scopeClazz = PerActivity.class,
modules = AppModule.class,
dependencies = AppComponent.class)
public class LoginActivity extends BaseActivity<LoginPresenter> implements ILoginView {
...
}
among name You can write your name directly , Such as :"login", It can be used "." Segmentation , Such as :“login.login”, This will generate login Catalog , This directory is regenerated into the corresponding java file .
take MvpFastDagger Into your project
stay Gradle Configure settings in :
1. At the root build.gradle The configuration in the file is as follows :
allprojects {
repositories {
...
maven { url "https://jitpack.io" } // Add the configuration , Enable compile time from jitpack Find resource in Library
}
}
2. stay app Project build.gradle Add reference to the document :
android {
...
defaultConfig {
javaCompileOptions{
annotationProcessorOptions{
arguments = ["fastDaggerIndex": "org.harry.fastdagger.demo",// Configure your package name here , The generated files will be in this directory
"mvpSrcDir" : file("src/main/java").getAbsolutePath()]// Main works src route , Generally, this value does not need to be modified
}
}
}
}
dependencies {
...
implementation 'com.github.zhang-hai:mvpfastdagger:1.1.0' // Use mvpfastdagger library
annotationProcessor 'com.github.zhang-hai:mvpfastdagger:1.1.0' // Use mvpfastdagger Annotation processor in the library
}
边栏推荐
- MySQL创建给出语句
- Notes on writing questions in C language -- monkeys eat peaches
- 请问在手机上开户股票,还是去证券公司开户安全?
- Where is safe for FTSE A50 to open an account
- Compare and explain common i/o models
- 2台三菱PLC走BCNetTCP协议,能否实现网口无线通讯?
- 【mysql学习笔记22】索引
- Register the jar package as a service to realize automatic startup after startup
- Reza RA series - development environment construction
- How to delete a blank page that cannot be deleted in word
猜你喜欢
Reza RA series - development environment construction
[matlab] image binarization (imbinarize function)
How to "transform" small and micro businesses (II)?
203 postgraduate entrance examination Japanese self-study postgraduate entrance examination experience post; Can I learn Japanese by myself?
Why should the terminal retail industry choose the member management system
x86的编码格式
Tiktok brand goes to sea: both exposure and transformation are required. What are the skills of information flow advertising?
Puzzle (019.2) hexagonal lock
Wechat official account can reply messages normally, but it still prompts that the service provided by the official account has failed. Please try again later
Remittance international empowers cross-border e-commerce: to be a compliant cross-border payment platform!
随机推荐
Neat Syntax Design of an ETL Language (Part 2)
可穿戴设备或将会泄露个人隐私
Summarize two methods of configuring pytorch GPU environment
Reza RA series - development environment construction
匯付國際為跨境電商賦能:做合規的跨境支付平臺!
[smart agriculture program] smart agriculture small program project is currently popular.
Download the arm64 package of Debian on X86 computer
manhattan_slam环境配置
Chitubox micromake l3+ slicing software configuration correspondence
[IOU] intersection over union
Wallys/MULTI-FUNCTION IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL
Wearable devices may reveal personal privacy
How to delete a blank page that cannot be deleted in word
CyCa 2022 children's physical etiquette primary teacher class Shenzhen headquarters station successfully concluded
PMP考试多少分算通过?
Set the location permission in the shutter to "always allow"
Rxjs TakeUntil 操作符的学习笔记
Oracle function trigger
Flutter replaces the default icon of Gaud positioning
What functions should smart agriculture applet system design have