Conversation
|
Kudos, SonarCloud Quality Gate passed! |
Alex009
left a comment
There was a problem hiding this comment.
also CI should be fixed.
use ./gradlew build to test
|
|
||
| package dev.icerock.moko.media | ||
|
|
||
| expect fun FileMedia.toByteArray(): ByteArray |
There was a problem hiding this comment.
revert please. this change of public api
| val name: String, | ||
| val path: String | ||
| val path: String, | ||
| val byteArray: ByteArray |
There was a problem hiding this comment.
store of readed file is not optimized.
you can save some additional data about reading of file to this obj, but not store ByteArray please - it can be large
| package dev.icerock.moko.media | ||
|
|
||
| data class Media( | ||
| data class Media constructor( |
| if (callbackData !is CallbackData.Camera){ | ||
| callbackData.callback.invoke( | ||
| Result.failure( | ||
| java.lang.IllegalStateException("Callback type should be Camera") |
| "application/pdf", | ||
| "application/octet-stream", | ||
| "application/doc", | ||
| "application/msword", | ||
| "application/ms-doc", | ||
| "application/vnd.ms-excel", | ||
| "application/vnd.ms-powerpoint", | ||
| "application/json", | ||
| "application/zip", | ||
| "text/plain", | ||
| "text/html", | ||
| "text/xml", | ||
| "audio/mpeg", | ||
| "application/vnd.openxmlformats-officedocument.wordprocessingml.document", | ||
| "application/vnd.openxmlformats-officedocument.presentationml.presentation", | ||
| "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" |
| val byteArray = requireContext() | ||
| .contentResolver | ||
| .openInputStream(uri) | ||
| ?.readBytes() ?: return@registerForActivityResult |
There was a problem hiding this comment.
why we should read stream in this time? can we read it later?
|
|
||
| val cursorRef = contentResolver | ||
| .query(uri, projection, null, null, null) | ||
| .query(uri, null, null, null, null) |
There was a problem hiding this comment.
why projection removed? we use only 2 columns at all
|
|
||
| val cursorRef = contentResolver | ||
| .query(uri, projection, null, null, null) | ||
| .query(uri, null, null, null, null) |
There was a problem hiding this comment.
why projection removed? we use only 2 columns at all
| <provider | ||
| android:name="androidx.core.content.FileProvider" | ||
| android:authorities="${applicationId}.provider" | ||
| android:exported="false" | ||
| android:grantUriPermissions="true"> | ||
| <meta-data | ||
| android:name="android.support.FILE_PROVIDER_PATHS" | ||
| android:resource="@xml/file_provider_paths" /> | ||
| </provider> |
There was a problem hiding this comment.
for what purpose we should add provider? we not share own files outside of app
# Conflicts: # media/src/androidMain/kotlin/dev/icerock/moko/media/picker/MediaPickerControllerImpl.kt








No description provided.