-
Notifications
You must be signed in to change notification settings - Fork 38
Tests for LocalMediaRepository #329
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
base: main
Are you sure you want to change the base?
Conversation
Fill out the MediaRepository interface
Apply Spotless
fc81f5b
to
83747b1
Compare
1548bb2
to
b1b91af
Compare
@IODispatcher private val iODispatcher: CoroutineDispatcher | ||
) : MediaRepository { | ||
|
||
override suspend fun load(mediaDescriptor: MediaDescriptor): Media { |
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.
nit: i think it would be helpful for fresh eyes down the road to include some kdocs that describe the significance between what load()
and getLastCapturedMedia()
are doing.
val loadedBitmap = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { | ||
// Android 10 (API 29) and above: Use ImageDecoder | ||
context.contentResolver.openInputStream(uri)?.use { inputStream -> | ||
BitmapFactory.decodeStream(inputStream) | ||
} | ||
} else { | ||
// Android 9 (API 28) and below: Use BitmapFactory | ||
context.contentResolver.openInputStream(uri)?.use { inputStream -> | ||
BitmapFactory.decodeStream(inputStream) | ||
} |
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.
you are using BitmapFactory
for both of these cases
* limitations under the License. | ||
*/ | ||
|
||
package media |
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.
package name?
46c712e
to
8b2632c
Compare
Apply Spotless