Convert dependency inject ("di") package to kotlin (#5976)

* Convert a batch of easier modules

* Convert the NetworkingModule to kotlin

* Converted the ApplicationlessInjection to kotlin

* Convert CommonsDaggerAppCompatActivity to kotlin

* Convert CommonsDaggerContentProvider to kotlin

* Convert CommonsDaggerIntentService to kotlin

* Convert CommonsDaggerService to kotlin

* Convert CommonsDaggerSupportFragment to kotlin

* Convert CommonsDaggerBroadcastReceiver to kotlin

* Convert CommonsApplicationModule to kotlin

* Fix imports and make them consistent
This commit is contained in:
Paul Hawke 2024-11-29 19:50:42 -06:00 committed by GitHub
parent dac3657536
commit 1e5521b434
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 1274 additions and 1465 deletions

View file

@ -37,9 +37,8 @@ class TestCommonsApplication : Application() {
}
@Suppress("MemberVisibilityCanBePrivate")
class MockCommonsApplicationModule(
appContext: Context,
) : CommonsApplicationModule(appContext) {
class MockCommonsApplicationModule(appContext: Context) : CommonsApplicationModule(appContext) {
val defaultSharedPreferences: JsonKvStore = mock()
val locationServiceManager: LocationServiceManager = mock()
val mockDbOpenHelper: DBOpenHelper = mock()
@ -50,16 +49,13 @@ class MockCommonsApplicationModule(
val modificationClient: ContentProviderClient = mock()
val uploadPrefs: JsonKvStore = mock()
override fun provideCategoryContentProviderClient(context: Context?): ContentProviderClient = categoryClient
override fun provideCategoryContentProviderClient(context: Context): ContentProviderClient = categoryClient
override fun provideContributionContentProviderClient(context: Context?): ContentProviderClient = contributionClient
override fun provideContributionContentProviderClient(context: Context): ContentProviderClient = contributionClient
override fun provideModificationContentProviderClient(context: Context?): ContentProviderClient = modificationClient
override fun provideModificationContentProviderClient(context: Context): ContentProviderClient = modificationClient
override fun providesDefaultKvStore(
context: Context,
gson: Gson,
): JsonKvStore = defaultSharedPreferences
override fun providesDefaultKvStore(context: Context, gson: Gson): JsonKvStore = defaultSharedPreferences
override fun provideLocationServiceManager(context: Context): LocationServiceManager = locationServiceManager