|
|
@ -15,6 +15,7 @@ import org.tasks.locale.Locale
|
|
|
|
import org.tasks.location.Geocoder
|
|
|
|
import org.tasks.location.Geocoder
|
|
|
|
import org.tasks.location.MapboxGeocoder
|
|
|
|
import org.tasks.location.MapboxGeocoder
|
|
|
|
import org.tasks.notifications.NotificationDao
|
|
|
|
import org.tasks.notifications.NotificationDao
|
|
|
|
|
|
|
|
import javax.inject.Singleton
|
|
|
|
|
|
|
|
|
|
|
|
@Module
|
|
|
|
@Module
|
|
|
|
class ApplicationModule(@get:Provides @get:ApplicationContext val context: Context) {
|
|
|
|
class ApplicationModule(@get:Provides @get:ApplicationContext val context: Context) {
|
|
|
@ -24,59 +25,59 @@ class ApplicationModule(@get:Provides @get:ApplicationContext val context: Conte
|
|
|
|
get() = Locale.getInstance(context)
|
|
|
|
get() = Locale.getInstance(context)
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getJavaLocale(locale: Locale): java.util.Locale = locale.locale
|
|
|
|
fun getJavaLocale(locale: Locale): java.util.Locale = locale.locale
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getNotificationDao(db: Database): NotificationDao = db.notificationDao()
|
|
|
|
fun getNotificationDao(db: Database): NotificationDao = db.notificationDao()
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getTagDataDao(db: Database): TagDataDao = db.tagDataDao
|
|
|
|
fun getTagDataDao(db: Database): TagDataDao = db.tagDataDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getUserActivityDao(db: Database): UserActivityDao = db.userActivityDao
|
|
|
|
fun getUserActivityDao(db: Database): UserActivityDao = db.userActivityDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getTaskAttachmentDao(db: Database): TaskAttachmentDao = db.taskAttachmentDao
|
|
|
|
fun getTaskAttachmentDao(db: Database): TaskAttachmentDao = db.taskAttachmentDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getTaskListMetadataDao(db: Database): TaskListMetadataDao = db.taskListMetadataDao
|
|
|
|
fun getTaskListMetadataDao(db: Database): TaskListMetadataDao = db.taskListMetadataDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getGoogleTaskDao(db: Database): GoogleTaskDao = db.googleTaskDao
|
|
|
|
fun getGoogleTaskDao(db: Database): GoogleTaskDao = db.googleTaskDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getAlarmDao(db: Database): AlarmDao = db.alarmDao
|
|
|
|
fun getAlarmDao(db: Database): AlarmDao = db.alarmDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getGeofenceDao(db: Database): LocationDao = db.locationDao
|
|
|
|
fun getGeofenceDao(db: Database): LocationDao = db.locationDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getTagDao(db: Database): TagDao = db.tagDao
|
|
|
|
fun getTagDao(db: Database): TagDao = db.tagDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getFilterDao(db: Database): FilterDao = db.filterDao
|
|
|
|
fun getFilterDao(db: Database): FilterDao = db.filterDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getGoogleTaskListDao(db: Database): GoogleTaskListDao = db.googleTaskListDao
|
|
|
|
fun getGoogleTaskListDao(db: Database): GoogleTaskListDao = db.googleTaskListDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getCaldavDao(db: Database): CaldavDao = db.caldavDao
|
|
|
|
fun getCaldavDao(db: Database): CaldavDao = db.caldavDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getTaskDao(db: Database, workManager: WorkManager): TaskDao {
|
|
|
|
fun getTaskDao(db: Database, workManager: WorkManager): TaskDao {
|
|
|
|
val taskDao = db.taskDao
|
|
|
|
val taskDao = db.taskDao
|
|
|
|
taskDao.initialize(workManager)
|
|
|
|
taskDao.initialize(workManager)
|
|
|
@ -84,7 +85,7 @@ class ApplicationModule(@get:Provides @get:ApplicationContext val context: Conte
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@ApplicationScope
|
|
|
|
@Singleton
|
|
|
|
fun getDeletionDao(db: Database): DeletionDao = db.deletionDao
|
|
|
|
fun getDeletionDao(db: Database): DeletionDao = db.deletionDao
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|