All Projects → xujiaji → XMVP

xujiaji / XMVP

Licence: Apache-2.0 license
This is a mvp framework to help you easily achieve mvp structure.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to XMVP

Mvparms
⚔️ A common architecture for Android applications developing based on MVP, integrates many open source projects, to make your developing quicker and easier (一个整合了大量主流开源项目高度可配置化的 Android MVP 快速集成框架).
Stars: ✭ 10,146 (+16532.79%)
Mutual labels:  mvp, mvp-architecture, mvp-android, mvp-library
Mvpart
🎨 A new Android MVP architecture (此框架旨在解决传统 MVP 类和接口太多, 并且 Presenter 和 View 通过接口通信过于繁琐, 重用 Presenter 代价太大等问题).
Stars: ✭ 776 (+1172.13%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Linkage Recyclerview
即使不用饿了么订餐,也请务必收藏好该库!🔥 一行代码即可接入,二级联动订餐列表。
Stars: ✭ 2,970 (+4768.85%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Kotlinmvparchitecture
Clean MVP Architecture with Dagger2 + Retrofit2 + Mockito + Fresco + EasiestGenericRecyclerAdapter using Kotlin. Added Unit Tests(Kotlin Tests)!
Stars: ✭ 143 (+134.43%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Armscomponent
📦 A complete android componentization solution, powered by MVPArms (MVPArms 官方快速组件化方案).
Stars: ✭ 1,664 (+2627.87%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Supermvp
MVP“美”图+新闻+天气预报+Material+RxJava3+Retrofit2+Glide4+AndroidX+Leakcanary+Butterknife
Stars: ✭ 763 (+1150.82%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Android Clean Architecture Boilerplate
Apply clean architecture on Android
Stars: ✭ 141 (+131.15%)
Mutual labels:  mvp, mvp-architecture, mvp-android
visum
Android reactive MVP stack
Stars: ✭ 19 (-68.85%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Memorize
🚀 Japanese-English-Mongolian dictionary. It lets you find words, kanji and more quickly and easily
Stars: ✭ 72 (+18.03%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Androidbasemvp
🚀一个快速搭建MVP+RxJava2+Retrofit 基础框架,主要是封装有Http网络请求、日志、缓存、加载等待、toast、页面状态布局管理、权限、RxBus、Glide图片加载等组件,方便快速开发新项目、减少开发成本。
Stars: ✭ 184 (+201.64%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Moxy
Moxy is MVP library for Android with incremental annotation processor and ktx features
Stars: ✭ 234 (+283.61%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Android Mvp Architecture
🏛 A basic sample android application to understand MVP in a very simple way. Just clone, build, run and understand MVP.
Stars: ✭ 203 (+232.79%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Android Kotlin Mvp Architecture
This repository contains a detailed sample app that implements MVP architecture in Kotlin using Dagger2, Room, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 615 (+908.2%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Android Mvp Basic Sample
Android MVP Basic Sample
Stars: ✭ 140 (+129.51%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Componentizationarch
Stars: ✭ 265 (+334.43%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Flair
This is powerful android framework
Stars: ✭ 31 (-49.18%)
Mutual labels:  mvp, mvp-architecture, mvp-android
mvp-android-template
MVP Android Template to give you a Quick Head Start for your next Android Project. It implements MVP Architecture using Dagger2, Room, RxJava2 , Retrofit2
Stars: ✭ 20 (-67.21%)
Mutual labels:  mvp, mvp-architecture, mvp-android
KotlinMvpTemplateGenerator
Android Studio template for Kotlin with MVP + Dagger2 + Retrofit2
Stars: ✭ 65 (+6.56%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Simple Mvp Retrofit Example
A simple example of a project using MVP architecture and Retrofit 2.0 library for Android for beginners.
Stars: ✭ 70 (+14.75%)
Mutual labels:  mvp, mvp-architecture, mvp-android
Mvpandroid
Sample app to demonstrate MVP (Model - View - Presenter) architecture in android
Stars: ✭ 91 (+49.18%)
Mutual labels:  mvp, mvp-architecture, mvp-android

banner GitHub release GitHub release

XMVP

This is a mvp framework to help you easily achieve mvp structure.

中文文档: XMVP(简洁的MVP框架)

Update

> v1.2.3-androidx change to androidx library

> v1.2.3 add onPresenterCircle method

> v1.2.2 Fragment lazy load data, and add cycle function in View. Fix some bug.

> v1.1.5 Can not create Presenter after fixing obfuscation

> v1.1.4 fixes the subclass Activity of the current Activity crashes because it can not create a Presenter.

> v1.1.3 Called after the start() method in Presenter has been put into View's onInit() method.

> v1.1.2 XBasePresenter add judgment to determine whether the view still exists.

> v1.1.1 Add a fragment of the extended V4 package in the 'io.xujiaji.xmvp.view.base.v4' package.

Introduction

  • You can call the method in step 2 directly through the presenter in the Activity or Fragment
  • You can call the definition of the View interface in Presenter method, and can be called by model in step 2 Model implementation of the class method
  • and the start and end methods in Presenter for the start and end of the Activity and Fragmentt lifecycle.
  • through XMVP you do not care about View, Presenter, Model is how to connect, you can easily decouple the project.
  • Finally you can easily build the code using the 'MVPManager' plugin

How to use?

First, Add xmvp dependency

dependencies {
    implementation 'com.github.xujiaji:xmvp:1.2.3'
}

or

Download aar

use androidx

dependencies {
    implementation 'com.github.xujiaji:xmvp:1.2.3-androidx'
}

Step1:define a contract

You need to define a contract in contracts package, it contains a extend 'XContract.Presenter' interface and a extend 'XContract.View' interface.

Example: HomeContract.java

public interface HomeContract {
    interface Presenter extends XContract.Presenter{
        void loadData(Activity activity);
    }

    interface View extends XContract.View{
        void loadStart();
        void loadEnd(List<FileEntity> fileEntities);
    }

    interface Model extends XContract.Model {
        void scanFile(final Activity activity, final FileHelper.Listener<List<FileEntity>> listener);
    }
}

Step2:An implementation class for the Model interface.

Example: HomeModel.java

public class HomeModel implements HomeContract.Model {
    @Override
    public void scanFile(final Activity activity, final FileHelper.Listener<List<FileEntity>> listener) {
        ...
    }
}

Step3:An implementation class for the Presenter interface.

Example: HomePresenter.java

public class HomePresenter extends XBasePresenter<HomeContract.View, HomeModel> implements HomeContract.Presenter {

    @Override
    public void loadData(Activity activity) {
        view.loadStart();
        model.scanFile(activity, new FileHelper.Listener<List<FileEntity>>() {
            @Override
            public void success(List<FileEntity> fileEntities) {
                view.loadEnd(fileEntities);
            }
        });
    }
}

Step4:An implementation class for the View interface.

Example: HomeActivity.java

public class HomeActivity extends XBaseActivity<HomePresenter> implements HomeContract.View {
    ...

    @Override
    public void onInitCircle() {
        ...
        presenter.loadData(this);
    }

    @Override
    public void onListenerCircle() {
        ...
    }

    ...

    @Override
    public void loadStart() {
        ...
    }

    @Override
    public void loadEnd(List<FileEntity> fileEntities) {
        ...
    }

    @Override
    public int layoutId() {
        return R.layout.activity_home;
    }
}

You think this MVP too much trouble?

MVPManager helps you manage MVP code quickly. link MVPManager

Home UML

mvp uml

License

   Copyright 2016 XuJiaji

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].