mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-19 12:28:53 +01:00
set up contactrepository to inflate phone number in contact
This commit is contained in:
@@ -6,7 +6,7 @@ import dagger.Component
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
@Component(modules = arrayOf(AppModule::class, ConversationsModule::class))
|
||||
@Component(modules = arrayOf(AppModule::class, ContactModule::class, ConversationsModule::class))
|
||||
interface AppComponent {
|
||||
|
||||
fun inject(fragment: ConversationListFragment)
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.moez.QKSMS.dagger
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import com.moez.QKSMS.data.repository.ContactRepository
|
||||
import com.moez.QKSMS.data.sync.SyncManager
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
@@ -18,8 +19,8 @@ class AppModule(var application: Application) {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideSyncManager(context: Context): SyncManager {
|
||||
return SyncManager(context)
|
||||
fun provideSyncManager(context: Context, contacts: ContactRepository): SyncManager {
|
||||
return SyncManager(context, contacts)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.moez.QKSMS.dagger
|
||||
|
||||
import android.content.Context
|
||||
import com.moez.QKSMS.data.repository.ContactRepository
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
class ContactModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideContactRepository(context: Context): ContactRepository {
|
||||
return ContactRepository(context)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user