-
Notifications
You must be signed in to change notification settings - Fork 12
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
Update android side #68
base: develop
Are you sure you want to change the base?
Conversation
Kudos, SonarCloud Quality Gate passed! |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert please. this change of public api
@@ -6,5 +6,6 @@ package dev.icerock.moko.media | |||
|
|||
class FileMedia( | |||
val name: String, | |||
val path: String | |||
val path: String, | |||
val byteArray: ByteArray |
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.
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
@@ -4,7 +4,7 @@ | |||
|
|||
package dev.icerock.moko.media | |||
|
|||
data class Media( | |||
data class Media 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.
why it changed?
if (callbackData !is CallbackData.Camera){ | ||
callbackData.callback.invoke( | ||
Result.failure( | ||
java.lang.IllegalStateException("Callback type should be Camera") |
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.
why java.lang?
"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" |
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.
maybe use something like **/*
?
val byteArray = requireContext() | ||
.contentResolver | ||
.openInputStream(uri) | ||
?.readBytes() ?: return@registerForActivityResult |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.