A framework that fits the team is a good framework

1. Project Introduction

This project is a lightweight template project based on kotlin + Mvp + Rxjava + Retrofit package. The project does not have too many redundant dependencies, suitable for rapid development and novice training.

2. Directory structure

├─.Gradle ├─.Idea ├─ App.main.java. Package │ ├─ API ├─ Base │ ├─ Base │ ├─ Net │ ├─ ├─ MVP │ ├─ contract ├─ ├─ Data ├─ ├─ Rx ├─ Rx Java │ ├─ MVP │ ├─ contract ├─ ├─ Data ├─ Logical processing layer (data loading page displays) │ ├ ─ ─ the UI │ │ └ ─ ─ the activity activity │ │ └ ─ ─ adapter adapter │ │ └ ─ ─ fragments fragments │ ├ ─ ─ utils tools │ ├ ─ ─ ├── Constants. Kt Global Constants │ ├── Extensions. Kt Extension functions │ ├─ MyApplication Build. Gradle ├ ─ ─ Settings. GradleCopy the code

3. The graphic

4. Technical selection

MvpArms KotlinMvpTemplate
Mvp + Rxjava + Retrofit + + componentization Dagger Kotlin+Mvp+Rxjava+Retrofit
Easy to use, there is a one-click generation tool, too much redundant code, not suitable for rapid development Easy to use, suitable for rapid development and novice
Mature framework Can be customized according to requirements
Java Kotlin
Why compare with MvpArms? This simple framework is just a basic framework, in fact, there is no need to compare with other frameworks, but I have used MvpArms for a period of time before, and I have learned a lot from it. However, not all company projects are big projects, and may face the demand of rapid development. Some functions of all MvpArms are not suitable for them. A framework that fits the team is a good frameworkCopy the code

5. Technical points

The main third-party open source frameworks used are:

  • RxJava
  • RxAndroid
  • Retrofit
  • Glide
  • Logger
  • SmartRefreshLayout

6. Subsequent updates

  • Add Dagger2 to replace redundant code with tags
  • Open one-click contract-Model-Presenter tool generation

7. Simple renderings

The function of the project is relatively simple, just a simple picture display. At present, the project encapsulates the following points:

  • The network requests RetrofitManager encapsulation
  • Network request load – failure – success MultipleStatusView is a useful tool
  • Base基类 activity – fragment – adapter
  • Glide encapsulation
  • Rxjava encapsulation
  • Various tool class packages
  • Shape and gradient various graphics packaging
  • Animation encapsulation

8. Thanks a lot

  • MvpArms
  • KotlinMvp

9. Project address

  • Your Star and Fork are my eternal quest