Skip to content

Commit aa3ce7d

Browse files
feat: migrate sign up to jetpack compose and java to kotlin
1 parent 59aa4cc commit aa3ce7d

File tree

98 files changed

+352168
-23043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+352168
-23043
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.mifos.mobilewallet.mifospay.core.network
2+
3+
import javax.inject.Qualifier
4+
import kotlin.annotation.AnnotationRetention.RUNTIME
5+
6+
@Qualifier
7+
@Retention(RUNTIME)
8+
annotation class Dispatcher(val mifosDispatcher: MifosDispatchers)
9+
10+
enum class MifosDispatchers {
11+
Default,
12+
IO,
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package org.mifos.mobilewallet.mifospay.core.network.di
2+
3+
import org.mifos.mobilewallet.mifospay.core.network.Dispatcher
4+
import org.mifos.mobilewallet.mifospay.core.network.MifosDispatchers.Default
5+
import dagger.Module
6+
import dagger.Provides
7+
import dagger.hilt.InstallIn
8+
import dagger.hilt.components.SingletonComponent
9+
import kotlinx.coroutines.CoroutineDispatcher
10+
import kotlinx.coroutines.CoroutineScope
11+
import kotlinx.coroutines.SupervisorJob
12+
import javax.inject.Qualifier
13+
import javax.inject.Singleton
14+
15+
@Retention(AnnotationRetention.RUNTIME)
16+
@Qualifier
17+
annotation class ApplicationScope
18+
19+
@Module
20+
@InstallIn(SingletonComponent::class)
21+
internal object CoroutineScopesModule {
22+
@Provides
23+
@Singleton
24+
@ApplicationScope
25+
fun providesCoroutineScope(
26+
@Dispatcher(Default) dispatcher: CoroutineDispatcher,
27+
): CoroutineScope = CoroutineScope(SupervisorJob() + dispatcher)
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.mifos.mobilewallet.mifospay.core.network.di
2+
3+
import org.mifos.mobilewallet.mifospay.core.network.Dispatcher
4+
import org.mifos.mobilewallet.mifospay.core.network.MifosDispatchers.Default
5+
import org.mifos.mobilewallet.mifospay.core.network.MifosDispatchers.IO
6+
import dagger.Module
7+
import dagger.Provides
8+
import dagger.hilt.InstallIn
9+
import dagger.hilt.components.SingletonComponent
10+
import kotlinx.coroutines.CoroutineDispatcher
11+
import kotlinx.coroutines.Dispatchers
12+
13+
@Module
14+
@InstallIn(SingletonComponent::class)
15+
object DispatchersModule {
16+
@Provides
17+
@Dispatcher(IO)
18+
fun providesIODispatcher(): CoroutineDispatcher = Dispatchers.IO
19+
20+
@Provides
21+
@Dispatcher(Default)
22+
fun providesDefaultDispatcher(): CoroutineDispatcher = Dispatchers.Default
23+
}

0 commit comments

Comments
 (0)