Skip to content

Commit

Permalink
ANDROAPP-4954 Implement commons sync (#24)
Browse files Browse the repository at this point in the history
* feat: [ANDROAPP-4954] Use commons sync process

* [ANDROAPP-4954] Remove sync logic

* feat: [ANDROAPP-4954] Reload data when sync finishes

* feat: [ANDROAPP-4954] Testing coroutines

* feat: [ANDROAPP-4954] KTLINT check

* feat: [ANDROAPP-4954] Fix unused imports

* feat: [ANDROAPP-4954] Fix code style
  • Loading branch information
andresmr committed Feb 8, 2023
1 parent 9cf3bfb commit 4452b41
Show file tree
Hide file tree
Showing 17 changed files with 111 additions and 628 deletions.
4 changes: 3 additions & 1 deletion buildsystem/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ ext {
hilt_work : '1.0.0',

//Kotlin metadata
kotlinmetadata : "0.5.0"
kotlinmetadata : "0.5.0",

coroutines_test : "1.6.4"
]
}
16 changes: 0 additions & 16 deletions commons/src/test/java/org/dhis2/commons/ExampleUnitTest.kt

This file was deleted.

2 changes: 1 addition & 1 deletion stock-managment/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ dependencies {
testImplementation "org.mockito:mockito-inline:$libraries.mockito_inline"
testImplementation "androidx.arch.core:core-testing:$libraries.android_core_testing"
testImplementation "com.github.javafaker:javafaker:$libraries.javafaker"
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$libraries.coroutines_test"

androidTestImplementation "androidx.test.ext:junit:$libraries.junit_ext"
androidTestImplementation "androidx.test.espresso:espresso-core:$libraries.espresso_core"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ import org.dhis2.android.rtsm.services.OpenIdProvider
import org.dhis2.android.rtsm.services.OpenIdProviderImpl
import org.dhis2.android.rtsm.services.SpeechRecognitionManager
import org.dhis2.android.rtsm.services.SpeechRecognitionManagerImpl
import org.dhis2.android.rtsm.services.SyncManager
import org.dhis2.android.rtsm.services.SyncManagerImpl
import org.dhis2.android.rtsm.services.WorkManagerController
import org.dhis2.android.rtsm.services.WorkManagerControllerImpl
import org.dhis2.android.rtsm.services.preferences.PreferenceProvider
import org.dhis2.android.rtsm.services.preferences.PreferenceProviderImpl
import org.dhis2.android.rtsm.services.rules.ExpressionEvaluatorImpl
import org.dhis2.android.rtsm.utils.ConfigUtils
import org.dhis2.android.rtsm.utils.Sdk
import org.dhis2.commons.resources.ResourceManager
import org.hisp.dhis.android.core.D2
import org.hisp.dhis.rules.RuleExpressionEvaluator

Expand Down Expand Up @@ -53,22 +50,6 @@ class AppModule {
return WorkManager.getInstance(appContext)
}

@Provides
@Singleton
fun providesWorkManagerController(workManager: WorkManager): WorkManagerController {
return WorkManagerControllerImpl(workManager)
}

@Provides
@Singleton
fun providesSyncManager(
d2: D2,
preferenceProvider: PreferenceProvider,
workManagerController: WorkManagerController
): SyncManager {
return SyncManagerImpl(d2, preferenceProvider, workManagerController)
}

@Provides
@Singleton
fun providesJexlEngine(): JexlEngine {
Expand All @@ -93,4 +74,10 @@ class AppModule {
fun provideOpenIdProvider(@ApplicationContext appContext: Context): OpenIdProvider {
return OpenIdProviderImpl(appContext.applicationContext)
}

@Provides
@Singleton
fun provideResourcesProvider(@ApplicationContext appContext: Context): ResourceManager {
return ResourceManager(appContext)
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4452b41

Please sign in to comment.