emcthye - FxRate

架構圖

MVP

Base

CurrencyListActivity

CurrencyTimelineActivity

Interactor

Router

功能:
導覽到 CurrencyTimelineActivity

Threading

兩個 Thread:

  • ThreadExecutor
  • UIThread

目前兩個 Thread 只有 UseCasue 類別中的 execute 方法中的 Observable使用

  public void execute(DisposableObserver<T> observer, Params params) {
    final Observable<T> observable = this.buildUseCaseObservable(params)
        .subscribeOn(Schedulers.from(threadExecutor))
        .observeOn(UIThread.getScheduler());
    addDisposable(observable.subscribeWith(observer));
  }

心得

UseCase 與 Thread 的使用方式很特殊。

  • UseCase 's Class Diagram

    不過從上面可以知道 UseCase 最終會由 Presenter 使用。
    而 Presenter 的使用方式與我目前專案實作的方式不一樣。

待學習

  • Clean Architecture Interactor
  • Android Use Case
  • Thread
  • io.reactivex
  • Presenter 實作方式的整理
  • VIPER Architecture

第三方套件

​​​​implementation 'androidx.appcompat:appcompat:1.2.0'
​​​​implementation 'com.google.android.material:material:1.2.1'
​​​​implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

​​​​implementation "com.squareup.moshi:moshi:1.11.0"
​​​​implementation "com.squareup.moshi:moshi-adapters:1.11.0"
​​​​implementation 'com.squareup.retrofit2:retrofit:2.9.0'
​​​​implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
​​​​implementation "com.squareup.retrofit2:converter-moshi:2.4.0"
​​​​implementation "com.squareup.okhttp3:logging-interceptor:3.9.0"
​​​​implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
​​​​debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'

​​​​implementation "io.reactivex.rxjava2:rxjava:2.2.21"
​​​​implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
​​​​implementation 'com.jakewharton:butterknife:10.2.3'
​​​​implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
​​​​implementation 'com.google.dagger:dagger:2.33'


​​​​annotationProcessor 'com.google.dagger:dagger-compiler:2.33'
​​​​annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'

​​​​testImplementation 'junit:junit:4.13.2'
​​​​testImplementation 'org.mockito:mockito-core:2.19.0'

​​​​androidTestAnnotationProcessor 'com.google.dagger:dagger-compiler:2.33'

​​​​androidTestImplementation 'androidx.test.ext:junit:1.1.2'
​​​​androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
​​​​androidTestImplementation 'androidx.test.espresso:espresso-intents:3.3.0'
​​​​androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
​​​​androidTestImplementation 'org.mockito:mockito-android:2.19.0'
​​​​androidTestImplementation 'androidx.test:runner:1.3.0'
​​​​androidTestImplementation 'androidx.test:rules:1.3.0'
tags: Android Note Android Test
Select a repo