More params for capturing image via image picker
val launcher = rememberCameraPickerLauncher( type = FileKitCameraType.Photo ) { file -> // Handle the captured photo }
The rememberCameraPickerLauncher has only one param asking for captureType, would be great to have more params like directory, name, format, etc
Internally it stores on cache for android and returns the platformFile, and we have to copy or move the file to correct assets dir/folder.
Hi @suhaibkazi!
You can move the file and put it where you want easily like this:
val scope = rememberCoroutineScope()
val takePhotoLauncher = rememberCameraPickerLauncher { file ->
scope.launch {
file?.atomicMove(FileKit.filesDir / "my-photo.jpg")
}
}
We can imagine improving the API by providing a new optional parameter called destinationFile:
val takePhotoLauncher = rememberCameraPickerLauncher(
destinationFile = FileKit.filesDir / "my-photo.jpg"
) { file ->
}
This keeps things simple while still being flexible. What do you think?
Agreed. I was inspired by the filepicker API since that has a lot of params to customise
PS thanks for the hack
I added the parameter like you suggested in FileKit 0.10.0 🎉
I'm closing, feel free to reopen if needed 👌