introduce KotlinResultCallAdapter for nice suspending network calls (#2415)

* introduce KotlinResultCallAdapter for nice suspending network calls

* fix tests
This commit is contained in:
Konrad Pozniak 2022-04-14 19:49:49 +02:00 committed by GitHub
commit 3e8c6a318a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 168 additions and 179 deletions

View file

@ -19,6 +19,7 @@ import android.content.Context
import android.content.SharedPreferences
import android.os.Build
import android.text.Spanned
import at.connyduck.calladapter.kotlinresult.KotlinResultCallAdapterFactory
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.keylesspalace.tusky.BuildConfig
@ -111,6 +112,7 @@ class NetworkModule {
.client(httpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
.addCallAdapterFactory(KotlinResultCallAdapterFactory.create())
.build()
}