diff --git a/app/src/main/java/com/google/samples/apps/nowinandroid/di/DaosModule.kt b/app/src/main/java/com/google/samples/apps/nowinandroid/di/DaosModule.kt index 33c0aab4d..0c07b7ae3 100644 --- a/app/src/main/java/com/google/samples/apps/nowinandroid/di/DaosModule.kt +++ b/app/src/main/java/com/google/samples/apps/nowinandroid/di/DaosModule.kt @@ -28,26 +28,24 @@ import dagger.hilt.components.SingletonComponent @Module @InstallIn(SingletonComponent::class) -interface DaosModule { - companion object { - @Provides - fun providesAuthorDao( - database: NiADatabase, - ): AuthorDao = database.authorDao() +object DaosModule { + @Provides + fun providesAuthorDao( + database: NiADatabase, + ): AuthorDao = database.authorDao() - @Provides - fun providesTopicsDao( - database: NiADatabase, - ): TopicDao = database.topicDao() + @Provides + fun providesTopicsDao( + database: NiADatabase, + ): TopicDao = database.topicDao() - @Provides - fun providesEpisodeDao( - database: NiADatabase, - ): EpisodeDao = database.episodeDao() + @Provides + fun providesEpisodeDao( + database: NiADatabase, + ): EpisodeDao = database.episodeDao() - @Provides - fun providesNewsResourceDao( - database: NiADatabase, - ): NewsResourceDao = database.newsResourceDao() - } + @Provides + fun providesNewsResourceDao( + database: NiADatabase, + ): NewsResourceDao = database.newsResourceDao() } diff --git a/app/src/main/java/com/google/samples/apps/nowinandroid/di/DatabaseModule.kt b/app/src/main/java/com/google/samples/apps/nowinandroid/di/DatabaseModule.kt index a9c134301..1952e64b3 100644 --- a/app/src/main/java/com/google/samples/apps/nowinandroid/di/DatabaseModule.kt +++ b/app/src/main/java/com/google/samples/apps/nowinandroid/di/DatabaseModule.kt @@ -28,16 +28,14 @@ import javax.inject.Singleton @Module @InstallIn(SingletonComponent::class) -interface DatabaseModule { - companion object { - @Provides - @Singleton - fun providesNiADatabase( - @ApplicationContext context: Context, - ): NiADatabase = Room.databaseBuilder( - context, - NiADatabase::class.java, - "nia-database" - ).build() - } +object DatabaseModule { + @Provides + @Singleton + fun providesNiADatabase( + @ApplicationContext context: Context, + ): NiADatabase = Room.databaseBuilder( + context, + NiADatabase::class.java, + "nia-database" + ).build() }