Skip to content
项目

关于

🎨 一种新的 Android MVP 架构,旨在解决传统 MVP 中类和接口过多、Presenter 与 View 通过接口通信过于繁琐,以及 Presenter 复用成本过高等问题。

网站与应用开发

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README-zh.md

原文

MVPArt

Latest Stable Version Build Status Min Sdk Version License Author QQ Group

A New Android MVP Architecture

此框架旨在解决传统 MVP 类和接口太多, 并且 Presenter 和 View 通过接口通信过于繁琐, 重用 Presenter 代价太大等问题

Architectural

Introduction

Master 分支

Master 分支是一个不含网络层的简易框架,主要通过4个 Demo 介绍本框架的思想,特性以及使用方法,小巧灵活适合已经有一整套现有框架但又需要重构为 MVP 结构的项目,但不管你使用哪个分支都强烈建议你先看看 Master 分支的 Demo

Complete 分支

Complete 分支是一个含有网络层的完整框架,将 Retrofit 作为网络层并使用 Dagger2 管理所有对象,成熟强大适合新建的项目

Wiki

详细使用方法及扩展功能,请参照 Wiki 文档

Tips: MVPArt 和 MVPArms 的主要区别在于 MVP 中的 V 和 P 的交互方式 (Master 分支中详细描述), 其他核心功能基本一致, 所以文档中大部分内容两者都可以共用

Notice

  • 使用之前,请参阅 传统MVP用在项目中是真的方便还是累赘?

  • 使用 Template 自动生成 MVP 相关类

  • 此框架是一个轻量级框架,比较适合中小型项目,大型项目请使用 MVPArms

  • 传统MVP每个页面对应一个 Presenter ,而大多数 Presenter 只有一两个方法,这样导致存在大量代码寥寥无几的 Presenter ,此框架旨在解决复用 Presenter 时需要实现过多多余接口方法的问题,鼓励开发者将相近的逻辑写在一个 Presenter 中,不断重用 Presenter ,减少大量类文件

  • 当然很多不同的逻辑都写在一个 Presenter 中,虽然可以少写很多类,但是后面的扩展性肯定不好,所以这个粒度需要自己控制,但是对于外包项目简直是福音

Download

 implementation 'me.jessyan:art:2.5.0'

 ---------------------- 以下是扩展库 ----------------------
 
 //想使用 Glide 请依赖 art-imageloader-glide 扩展库
 implementation 'me.jessyan:art-imageloader-glide:2.5.0' 
 
 //想使用 AndroidAutoLayout 请依赖 art-autolayout 扩展库
 implementation 'me.jessyan:art-autolayout:2.5.0'

About Me

License

 Copyright 2017, jessyan

   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.

探索相关项目

加载中…