-
Notifications
You must be signed in to change notification settings - Fork 56
Create a media module with MediaRepository #326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
data/media/src/main/kotlin/com/google/jetpackcamera/data/media/LocalMediaRepository.kt
Show resolved
Hide resolved
data/media/src/main/kotlin/com/google/jetpackcamera/data/media/MediaRepository.kt
Outdated
Show resolved
Hide resolved
data/media/src/main/kotlin/com/google/jetpackcamera/data/media/MediaRepository.kt
Outdated
Show resolved
Hide resolved
data/media/src/main/kotlin/com/google/jetpackcamera/data/media/MediaRepository.kt
Outdated
Show resolved
Hide resolved
data/media/src/main/kotlin/com/google/jetpackcamera/data/media/MediaRepository.kt
Outdated
Show resolved
Hide resolved
data/media/src/main/kotlin/com/google/jetpackcamera/data/media/MediaRepository.kt
Show resolved
Hide resolved
| */ | ||
| package com.google.jetpackcamera.data.media | ||
|
|
||
| class LocalMediaRepository : MediaRepository { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to use Hilt @Inject constructor()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class doesn't currently have any parameters, so I don't think this is necessary.
| @Provides | ||
| @Singleton | ||
| fun provideMediaRepository(): MediaRepository = LocalMediaRepository() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be use @Binds, rather than @Provides.
@Binds
@Singleton
fun provideMediaRepository(localMediaRepository : LocalMediaRepository): MediaRepository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @Provides is fine here because this is a class method, not an interface/abstract.
| */ | ||
| package com.google.jetpackcamera.data.media | ||
|
|
||
| class LocalMediaRepository : MediaRepository { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class doesn't currently have any parameters, so I don't think this is necessary.
| @Provides | ||
| @Singleton | ||
| fun provideMediaRepository(): MediaRepository = LocalMediaRepository() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @Provides is fine here because this is a class method, not an interface/abstract.
Fill out the MediaRepository interface
Change Media and MediaDescriptor into interfaces Add more KDoc Add object Error to Media
5433415 to
1a16a3c
Compare
MediaRepositorythat can be used to query MediaStore for media created by JCA.It'll be used for showing the media thumbnails in
PreviewScreen, and for displaying the media items inPostCaptureScreen.Implementation in #328
Usage in #330