All Projects → passin95 → P-MVP

passin95 / P-MVP

Licence: other
[停止维护]基于 dagger.android,简单实用的 MVP 框架

Programming Languages

java
68154 projects - #9 most used programming language
FreeMarker
481 projects

Projects that are alternatives of or similar to P-MVP

Archcomp
使用Dagger,LiveData,ViewModel,Rxjava ,Retrofit等搭建App业务模块组件化框架。并处理多个系统提供数据导致的返回数据格式不一致,More ,please readme
Stars: ✭ 127 (+746.67%)
Mutual labels:  mvp, dagger2-android
CleanArchitecture-SocketIO
CleanArchitecture with SocketIo 📡
Stars: ✭ 32 (+113.33%)
Mutual labels:  mvp, dagger2-android
Klean-ArchiteKture
Kotlin Android clean-architecture demo project for a meetup talk. Slides: https://docs.google.com/presentation/d/1CxnntHf3CorNDicx_cDN5s1t5pEbUwjwWHZ5PNmfe6Y/edit?usp=sharing
Stars: ✭ 10 (-33.33%)
Mutual labels:  mvp, dagger2-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 (+33.33%)
Mutual labels:  mvp, dagger2-android
Mvp Dagger2 Rxjava2
Android 基本mvp+dagger(dagger2.android)+rxjava2+retrofit+ormdb框架。简单组件化架构 with Base Activity,Presenter ,View,Model 的抽象封装,http 请求封装&错误统一处理
Stars: ✭ 274 (+1726.67%)
Mutual labels:  mvp, dagger2-android
AndroidMVPArchitecture
Android MVP architecture sample project with or without RxJava and Dagger2 and Kotlin
Stars: ✭ 78 (+420%)
Mutual labels:  mvp, dagger2-android
uv-index
This is a work-in-progress (🔧️) ultraviolet index viewer app for demonstrating Instant Apps + Kotlin + Dagger + MVP
Stars: ✭ 64 (+326.67%)
Mutual labels:  mvp, dagger2-android
Mvp With Dagger 2.11
Stars: ✭ 20 (+33.33%)
Mutual labels:  mvp, dagger2-android
Readhub
ReadHub Client 非官方客户端
Stars: ✭ 179 (+1093.33%)
Mutual labels:  mvp, dagger2-android
MVVMQuick
🚀使用MVVMQuick快速构建您的MVVM结构项目!(Quickly start projects with MVVMQuick!)
Stars: ✭ 23 (+53.33%)
Mutual labels:  dagger2-android
AlquranQ
Terjemahan Alquran Bahasa Indonesia & Bahasa Inggris
Stars: ✭ 26 (+73.33%)
Mutual labels:  mvp
COVID-19-Bangladesh-Android
An end to end tool from general public to govt portal & an awareness tool with CoronaVirus Facts, Mythbusters & Support to eradicate the language & context barrier of misinformation that's been spreading on social media & thus creating mass panic.
Stars: ✭ 57 (+280%)
Mutual labels:  dagger2-android
ThinkRchive
An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android.
Stars: ✭ 84 (+460%)
Mutual labels:  dagger2-android
wikilight
A lightweight Wikipedia Client
Stars: ✭ 50 (+233.33%)
Mutual labels:  mvp
Eva
Eva and Wall-e
Stars: ✭ 131 (+773.33%)
Mutual labels:  mvp
flutter fish
仿闲鱼 flutter demo
Stars: ✭ 19 (+26.67%)
Mutual labels:  mvp
AndroidStarterAlt
A sample View-based Android app using the MVP architecture. It uses Mosby, Dagger2, RxJava, retrofit, LoganSquare, requery, EventBus, Conductor.
Stars: ✭ 27 (+80%)
Mutual labels:  mvp
Starwars-clean
Simple project with clean architecture
Stars: ✭ 34 (+126.67%)
Mutual labels:  mvp
Li-MVPArms
这个项目会持续更新
Stars: ✭ 17 (+13.33%)
Mutual labels:  mvp
Dribbble
根据Dribbble 网站开源的API,将世界各大优秀设计师的作品,展示出来,用于学习MD设计和流式编程。项目采用Google设计规范Material Design设计开发,基础架构采用MVP模式进一步解耦, 使用流式编程框架RxJava + RxAndroid ,结合Retrofit客户端库组织网络框架,图片缓存库采用Google。
Stars: ✭ 20 (+33.33%)
Mutual labels:  mvp

P-MVP:基于 dagger.android 的 MVP 框架

Explain

由于 Dagger 所带来的一些架构上的限制,不再选择使用 Dagger,若要使用 Dagger,则不推荐使用拓展库 Dagger Android。因为他带来的限制更大。

Latest Stable Version

Difference

  • 将所有的 activity、fragment、dialog 都看成一个个 page,以 page 为单位使用定义 P 和 M 层的@Scope(生命周期),相对来说很自由的复用 P 层和 M 层。
  • 不需要重复在每一个 V 层重复编写 Module 注入的代码。
  • 由于 Retrofit 已经做了一层接口封装,并且 M 层大部分都是网络请求,因此去掉了 M 层和 P 层的接口,可针对数据库单独写一个 M 层。
  • 删除了 ImageLoader 相关,个人觉得过于鸡肋,针对 App 功能的定位便应该决定好图片加载框架的选择,此外,基础框架本身的扩展性足够强,中间层设计就显得多此一举,甚至丧失了原有框架的良好特性。
  • 业务包名建议以界面为单位,方便同一界面类之间的查找和归类,如果需求需要删除某个界面,也只需要右键删除包名即可删除该界面的所有有关类。
  • 集成了 Fragmentation 去尽量避免 fragment 存在的坑,且方便管理和查看 fragment 栈,个人推荐对 fragment 的使用更多在于针对“碎片”的需求亦或某个很重要的界面需要比较快的启动速度,其余时候依旧推荐使用 activity。
  • 出于性能优化和实用性的考虑,取消了 activity 和 fragment 的生命周期代理类,因为 android sdk 已提供 activity 和 fragment 的生命周期回调 Api,已可在回调中进行想要的操作。

Explain

  • 不在 BaseActivity 中通过泛型生成 P 层的原因是,我某些时候希望我在不使用 P 层的时候依旧使用 dagger 注入的功能。
  • 在对比了实用性以及目前的维护情况等多方面因素后,最终选择了 AndPermission,碰到有关权限问题也推荐大家直接向严振杰老哥提 PR,为国产手机权限问题做贡献。
  • 给大家安利两种不错的屏幕适配方法,第一种方式(sw)相对完美,但会使 apk 大小增加几百 k,并且无法适配第三方activity;第二种方式 为今日头条适配方式的衍生版,已在 ScreenUtils 中提供,大家可根据实际情况选择使用。
  • 为了方便开发,根目录也提供了本人在组件化项目中使用的页面 tempelate,需要的可以参考一下根据自身需求修改。

Download

implementation 'me.passin:pmvp:0.1.2'

Thanks

License

 Copyright 2018, passin
  
   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].