XDroidMvp 輕量級的Android MVP快速開發框架

XDroidMvp是XDroidAndroid快速開發框架的MVP版本,其使用方式相似於XDroid,大部分源碼也來自XDroid。android

XDroidMvp主要會有這些特性:git

無需寫Contract! 無需寫Present接口! 無需寫View接口!github

新增:緩存

Mvp實現
RxJava & RxAndroid
權限適配 RxPermission
事件訂閱默認採用 RxBus
網絡交互:
    Retrofit + rx
    Https
    統一異常處理
    緩存
    支持多個baseUrl
    。。。。
無需擔憂rx內存泄漏

保留:網絡

提供XActivity、XFragment、SimpleRecAdapter、SimpleListAdapter等基類,可快速進行開發
完整封裝XRecyclerView,可實現絕大部分需求
XStateController、XRecyclerContentLayout實現loading、error、empty、content四種狀態的自由切換
實現了Memory、Disk、SharedPreferences三種方式的緩存,可自由擴展
內置了RxBus,可自由切換到其餘事件訂閱庫
內置Glide,可自由切換其餘圖片加載庫
可輸出漂亮的Log,支持Json、Xml、Throwable等,蠅量級實現
內置鏈式路由
內置經常使用工具類:package、random、file...,提供的都是很是經常使用的方法
內置加密工具類 XCodec,你想要的加密姿式都有

Get Startedapp

使用:框架

1.clondom

**apply from: "conf.gradle"**
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'com.bugtags.library:bugtags-gradle:latest.integration'
        **classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'**

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

3.將mvp做爲依賴庫,在您的app module 中 添加以下依賴:maven

compile project(‘:mvp’)ide

4.在根目錄的gradle文件中配置

e ‘XDroid’庫到本地: 
git clone https://github.com/limedroid/XDroidMvp.git

2.拷貝conf.gradle到您的項目根目錄,並修改項目gradle文件下引入: 
apply from: 「conf.gradle」 
如:

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

5.在app.gradle文件中加

apply plugin: 'com.neenbedankt.android-apt'

dependencies中加

apt rootProject.ext.dependencies["butterknife-apt"]

重要說明

ButterKnife使用的是8.4.0版本,重點是 @BindView,能夠去項目官網查看。
Rxlifecycle使用的是1.0版本,具體如何使用能夠查看官網。
RxPermissions使用的是0.9.1版本,具體如何使用能夠查看官網。
retrofit,具體如何使用能夠查看官網。

XDroidMvp全新文檔:https://github.com/limedroid/XDroidMvp/wiki

相關文章
相關標籤/搜索