Skip to content

Commit

Permalink
added missing injections to release flavor
Browse files Browse the repository at this point in the history
  • Loading branch information
LivingWithHippos committed Oct 2, 2020
1 parent eef4ae9 commit 5cb4a3e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ import javax.inject.Singleton
@Module
object ApiFactory {

/*********************************/
// N.B. all updates to this code //
// also need to be ported to the //
// release build flavor version. //
/*********************************/

@Provides
@Singleton
fun provideOkHttpClient(): OkHttpClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import com.github.livingwithhippos.unchained.data.remote.UnrestrictApiHelperImpl
import com.github.livingwithhippos.unchained.data.remote.UserApi
import com.github.livingwithhippos.unchained.data.remote.UserApiHelper
import com.github.livingwithhippos.unchained.data.remote.UserApiHelperImpl
import com.github.livingwithhippos.unchained.data.remote.VariousApi
import com.github.livingwithhippos.unchained.data.remote.VariousApiHelper
import com.github.livingwithhippos.unchained.data.remote.VariousApiHelperImpl
import com.github.livingwithhippos.unchained.utilities.BASE_AUTH_URL
import com.github.livingwithhippos.unchained.utilities.BASE_URL
import com.squareup.moshi.Moshi
Expand All @@ -42,6 +45,12 @@ import javax.inject.Singleton
@Module
object ApiFactory {

/*********************************/
// N.B. all updates to this code //
// also need to be ported to the //
// debug build flavor version. //
/*********************************/

@Provides
@Singleton
fun provideOkHttpClient(): OkHttpClient = OkHttpClient()
Expand Down Expand Up @@ -153,4 +162,16 @@ object ApiFactory {
@Singleton
fun provideHostsApiHelper(apiHelper: HostsApiHelperImpl): HostsApiHelper =
apiHelper

// various api injection
@Provides
@Singleton
fun provideVariousApi(@ApiRetrofit retrofit: Retrofit): VariousApi {
return retrofit.create(VariousApi::class.java)
}

@Provides
@Singleton
fun provideVariousApiHelper(apiHelper: VariousApiHelperImpl): VariousApiHelper =
apiHelper
}

0 comments on commit 5cb4a3e

Please sign in to comment.