JoosungPark / MaImageList

list image view from sepecific data(json or xml).
Apache License 2.0
0 stars 0 forks source link

Apply android mvvm with rxjava and retrofit #9

Open JoosungPark opened 7 years ago

JoosungPark commented 7 years ago

Ref. https://github.com/googlesamples/android-architecture

JoosungPark commented 7 years ago

branch : origin/mvvm_rxjava

JoosungPark commented 7 years ago

ref. retrofit : https://github.com/square/retrofit lambda : https://github.com/orfjackal/retrolambda RxJava: Android MVVM App structre with Retrofit, https://medium.com/@manuelvicnt/rxjava-android-mvvm-app-structure-with-retrofit-a5605fa32c00#.k8l4j169d

JoosungPark commented 7 years ago

Android MVVM App structre with Retrofit 도식화. rx_mvvm_retrofit

JoosungPark commented 7 years ago

diagram of RetrofitExample. https://blog.robinchutaux.com/blog/a-smart-way-to-use-retrofit/

retrofit_example

JoosungPark commented 7 years ago

to apply mvvm with rxjava and retrofit, it is need to combine upons.

JoosungPark commented 7 years ago

it is just blueprint-architecture.

getimages_rxandroid_retrofit

JoosungPark commented 7 years ago

use ReplaceBuilder to move from ImageFragment to ImageDetailFragment with imagesViewModel. and the definition of RecyclerAdapter is a bit more anxious.

JoosungPark commented 7 years ago

ref : https://github.com/amitshekhariitbhu/RxJava2-Android-Samples

JoosungPark commented 7 years ago

for more efficient design, insert AbstractRepository between ViewModel and RetrofitWrapper. ConcreteRepository creates an appropriate RetrofitWrapper instance. cf. AbstractRepository must return below method. \<Parameter> Flowable\<List\<ImageModel>> next(Parameter parameter)