mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-19 20:38:53 +01:00
add timestamps with formatting to messages
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package com.moez.QKSMS.dagger
|
||||
|
||||
import android.content.Context
|
||||
import com.moez.QKSMS.ui.conversations.ConversationListActivity
|
||||
import com.moez.QKSMS.data.model.Message
|
||||
import com.moez.QKSMS.data.repository.ConversationRepository
|
||||
import com.moez.QKSMS.ui.conversations.ConversationListActivity
|
||||
import com.moez.QKSMS.ui.messages.MessageAdapter
|
||||
import dagger.Component
|
||||
import javax.inject.Singleton
|
||||
|
||||
@@ -11,6 +13,8 @@ import javax.inject.Singleton
|
||||
interface AppComponent {
|
||||
|
||||
fun inject(activity: ConversationListActivity)
|
||||
fun inject(message: Message)
|
||||
fun inject(adapter: MessageAdapter)
|
||||
|
||||
fun provideContext(): Context
|
||||
fun provideConversationRepository(): ConversationRepository
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.moez.QKSMS.dagger
|
||||
|
||||
import com.moez.QKSMS.QKApplication
|
||||
|
||||
internal object AppComponentManager {
|
||||
|
||||
internal lateinit var appComponent: AppComponent
|
||||
private set
|
||||
|
||||
fun init(application: QKApplication) {
|
||||
appComponent = DaggerAppComponent.builder()
|
||||
.appModule(AppModule(application))
|
||||
.contactModule(ContactModule())
|
||||
.conversationsModule(ConversationsModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import android.app.Application
|
||||
import android.content.Context
|
||||
import com.moez.QKSMS.data.repository.ContactRepository
|
||||
import com.moez.QKSMS.data.sync.SyncManager
|
||||
import com.moez.QKSMS.util.DateFormatter
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import javax.inject.Singleton
|
||||
@@ -17,6 +18,12 @@ class AppModule(var application: Application) {
|
||||
return application
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideDateFormatter(context: Context): DateFormatter {
|
||||
return DateFormatter(context)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideSyncManager(context: Context, contacts: ContactRepository): SyncManager {
|
||||
|
||||
Reference in New Issue
Block a user