Skip to content

Conversation

@yasith
Copy link
Contributor

@yasith yasith commented Mar 5, 2025

MediaRepository that 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 in PostCaptureScreen.

Implementation in #328
Usage in #330

@yasith yasith marked this pull request as draft March 5, 2025 20:24
@yasith yasith requested review from Kimblebee and oceanjules March 13, 2025 20:12
@yasith yasith marked this pull request as ready for review March 13, 2025 20:12
@yasith yasith requested a review from Kimblebee March 18, 2025 21:16
@yasith yasith requested a review from Kimblebee March 19, 2025 20:35
*/
package com.google.jetpackcamera.data.media

class LocalMediaRepository : MediaRepository {
Copy link
Contributor

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()

Copy link
Collaborator

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.

Comment on lines +31 to +33
@Provides
@Singleton
fun provideMediaRepository(): MediaRepository = LocalMediaRepository()
Copy link
Contributor

@Jaehwa-Noh Jaehwa-Noh Mar 21, 2025

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

Copy link
Collaborator

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 {
Copy link
Collaborator

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.

Comment on lines +31 to +33
@Provides
@Singleton
fun provideMediaRepository(): MediaRepository = LocalMediaRepository()
Copy link
Collaborator

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.

yasith added 5 commits March 25, 2025 21:44
Fill out the MediaRepository interface
Change Media and MediaDescriptor into interfaces
Add more KDoc
Add object Error to Media
@yasith yasith force-pushed the yasith/mediaRepository branch from 5433415 to 1a16a3c Compare March 26, 2025 01:44
@yasith yasith merged commit cc4d74b into main Mar 26, 2025
6 checks passed
@yasith yasith deleted the yasith/mediaRepository branch March 26, 2025 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants