Git Product home page Git Product logo

rxjava2_retrofit2_okhttp3_databinding's Introduction

Rxjava2_Retrofit2_OkHttp3_DataBinding

使用了Rxjava2_Retrofit2_OkHttp3_DataBinding等一系列库,自己构建的MVPVM架构,有一些细节没有修改,但整体雏形还是可以用于项目开发。

引用

maven { url "https://jitpack.io" }

dependencies {
      compile 'com.github.renygit:Rxjava2_Retrofit2_OkHttp3_DataBinding:0.0.4'
}

使用

此库已重写,传送地址:https://github.com/renygit/MVPLib

Application初始化时调用InitUtils.init(this, BuildConfig.DEBUG);

Activity继承BaseActivity<ActivityMainBinding, MainViewModel, MainPresenter> 指定3个泛型,分别是默认生成的Binding、继承自库的BaseViewModel,继承自库的BasePresenter;
会自动实例化三个变量binding,viewModel,presenter;Fragment类似。

具体使用请看Demo,可以极大减少代码量,欢迎star,以后还会继续完善

近期会重写这个库,发布到另一个路径下,尽量不过度封装,也提供不使用BaseActivity的方法引用。另:用户名更改了一下。

Lib中引用到的库

compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:recyclerview-v7:25.1.1'

// other 日志
compile 'com.orhanobut:logger:1.15'
//滑动退出activity
compile 'com.jude:swipebackhelper:3.1.2'
//Gson
compile 'com.google.code.gson:gson:2.8.0'
//RxJava2 + RxAndroid
compile 'io.reactivex.rxjava2:rxjava:2.0.0'
compile 'org.reactivestreams:reactive-streams:1.0.0'
compile 'io.reactivex.rxjava2:rxandroid:2.0.0'
//OkHttp3 + Retrofit2
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.okio:okio:1.10.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
// Reservoir 缓存
compile 'com.anupcowkur:reservoir:3.1.0'
//cookie管理
compile 'com.github.franmontiel:PersistentCookieJar:v1.0.0'
//皮肤切换
compile 'com.zhy:changeskin:4.0.2'
compile 'com.wang.avi:library:2.1.3'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.