-
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
#34 Replace MaterialFilePicker dependency and fragmentActivity usage #81
base: develop
Are you sure you want to change the base?
#34 Replace MaterialFilePicker dependency and fragmentActivity usage #81
Conversation
5c0defb
to
e86c72a
Compare
…ediaPickerController method and remove fragmentManager usage at pickImage method
ebbb3d4
to
ccf893d
Compare
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.
required rework to fix large duplication
...mpose/src/androidMain/kotlin/dev/icerock/moko/media/compose/BindMediaPickerEffect.android.kt
Outdated
Show resolved
Hide resolved
media/src/androidMain/kotlin/dev/icerock/moko/media/picker/FilePickerDelegate.kt
Show resolved
Hide resolved
media/src/androidMain/kotlin/dev/icerock/moko/media/picker/ImagePickerDelegate.kt
Show resolved
Hide resolved
private var callback: CallbackData? = null | ||
|
||
private val takePictureLauncherHolder = MutableStateFlow<ActivityResultLauncher<Uri>?>(null) | ||
private val pickVisualMediaLauncherHolder = | ||
MutableStateFlow<ActivityResultLauncher<PickVisualMediaRequest>?>(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.
looks very simillar in multiple places. can we do reused implementation that will use in each case?
media/src/androidMain/kotlin/dev/icerock/moko/media/picker/ImagePickerDelegate.kt
Outdated
Show resolved
Hide resolved
.commitNow() | ||
} | ||
} | ||
val outputUri = createPhotoUri() |
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 create it here? in case of gallery we not need it at all
media/src/androidMain/kotlin/dev/icerock/moko/media/picker/MediaPickerDelegate.kt
Show resolved
Hide resolved
@@ -27,6 +27,10 @@ class ImageSelectionViewModel( | |||
selectImage(MediaSource.GALLERY) | |||
} | |||
|
|||
fun onFilePressed() { | |||
selectFile() |
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.
test it on ios too
media/src/androidMain/kotlin/dev/icerock/moko/media/picker/MediaPickerControllerImpl.kt
Show resolved
Hide resolved
import android.net.Uri | ||
import dev.icerock.moko.media.BitmapUtils | ||
|
||
internal abstract class ImagePickerDelegate<C, I> : PickerDelegate<C, I>() { |
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.
we should add here more common logic
No description provided.