mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 05:57:03 +05:30
refactor(di): replace Tangle with Whetstone
This commit is contained in:
parent
4a87682b68
commit
0232a4179a
23 changed files with 36 additions and 188 deletions
|
@ -21,7 +21,6 @@ android { namespace = "dev.msfjarvis.claw.core" }
|
|||
dependencies {
|
||||
api(libs.kotlinx.serialization.json)
|
||||
api(libs.okhttp.loggingInterceptor)
|
||||
implementation(projects.diScopes)
|
||||
implementation(libs.dagger)
|
||||
implementation(libs.javax.inject)
|
||||
implementation(libs.napier)
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.core.injection
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import com.squareup.anvil.annotations.ContributesTo
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dev.msfjarvis.claw.injection.scopes.AppScope
|
||||
|
||||
@Module
|
||||
@ContributesTo(AppScope::class)
|
||||
interface ContextModule {
|
||||
@get:Binds val Application.bindContext: Context
|
||||
}
|
|
@ -8,6 +8,7 @@ package dev.msfjarvis.claw.core.injection
|
|||
|
||||
import android.content.Context
|
||||
import android.net.TrafficStats
|
||||
import com.deliveryhero.whetstone.ForScope
|
||||
import com.deliveryhero.whetstone.app.ApplicationScope
|
||||
import com.squareup.anvil.annotations.ContributesTo
|
||||
import dagger.Binds
|
||||
|
@ -37,7 +38,7 @@ interface OkHttpModule {
|
|||
private const val THREAD_STATS_TAG = 0x000090000
|
||||
|
||||
@Provides
|
||||
fun provideCache(context: Context): Cache {
|
||||
fun provideCache(@ForScope(ApplicationScope::class) context: Context): Cache {
|
||||
return Cache(context.cacheDir, CACHE_SIZE_MB)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue