mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
fix: savePhotosFolder value not updating.
This commit is contained in:
@@ -32,7 +32,7 @@ class MediaOutputHelper(
|
|||||||
private const val VIDEO_MIME_TYPE = "video/mp4"
|
private const val VIDEO_MIME_TYPE = "video/mp4"
|
||||||
}
|
}
|
||||||
|
|
||||||
private val mediaStorageDir = activity.config.savePhotosFolder
|
private var config = activity.config
|
||||||
private val contentResolver = activity.contentResolver
|
private val contentResolver = activity.contentResolver
|
||||||
|
|
||||||
fun getImageMediaOutput(): MediaOutput.ImageCaptureOutput {
|
fun getImageMediaOutput(): MediaOutput.ImageCaptureOutput {
|
||||||
@@ -121,7 +121,7 @@ class MediaOutputHelper(
|
|||||||
|
|
||||||
private fun getOutputStreamMediaOutput(): MediaOutput.OutputStreamMediaOutput? {
|
private fun getOutputStreamMediaOutput(): MediaOutput.OutputStreamMediaOutput? {
|
||||||
var mediaOutput: MediaOutput.OutputStreamMediaOutput? = null
|
var mediaOutput: MediaOutput.OutputStreamMediaOutput? = null
|
||||||
val canWrite = canWriteToFilePath(mediaStorageDir)
|
val canWrite = canWriteToFilePath(config.savePhotosFolder)
|
||||||
if (canWrite) {
|
if (canWrite) {
|
||||||
val path = activity.getOutputMediaFilePath(true)
|
val path = activity.getOutputMediaFilePath(true)
|
||||||
val uri = getUriForFilePath(path)
|
val uri = getUriForFilePath(path)
|
||||||
@@ -144,9 +144,9 @@ class MediaOutputHelper(
|
|||||||
|
|
||||||
private fun getFileDescriptorMediaOutput(): MediaOutput.FileDescriptorMediaOutput? {
|
private fun getFileDescriptorMediaOutput(): MediaOutput.FileDescriptorMediaOutput? {
|
||||||
var mediaOutput: MediaOutput.FileDescriptorMediaOutput? = null
|
var mediaOutput: MediaOutput.FileDescriptorMediaOutput? = null
|
||||||
val canWrite = canWriteToFilePath(mediaStorageDir)
|
val canWrite = canWriteToFilePath(config.savePhotosFolder)
|
||||||
if (canWrite) {
|
if (canWrite) {
|
||||||
val parentUri = getUriForFilePath(mediaStorageDir) ?: return null
|
val parentUri = getUriForFilePath(config.savePhotosFolder) ?: return null
|
||||||
val videoFileName = activity.getOutputMediaFileName(false)
|
val videoFileName = activity.getOutputMediaFileName(false)
|
||||||
val documentUri = DocumentsContract.createDocument(
|
val documentUri = DocumentsContract.createDocument(
|
||||||
contentResolver,
|
contentResolver,
|
||||||
@@ -162,7 +162,7 @@ class MediaOutputHelper(
|
|||||||
|
|
||||||
private fun getFileMediaOutput(): MediaOutput.FileMediaOutput? {
|
private fun getFileMediaOutput(): MediaOutput.FileMediaOutput? {
|
||||||
var mediaOutput: MediaOutput.FileMediaOutput? = null
|
var mediaOutput: MediaOutput.FileMediaOutput? = null
|
||||||
val canWrite = canWriteToFilePath(mediaStorageDir)
|
val canWrite = canWriteToFilePath(config.savePhotosFolder)
|
||||||
if (canWrite) {
|
if (canWrite) {
|
||||||
val path = activity.getOutputMediaFilePath(false)
|
val path = activity.getOutputMediaFilePath(false)
|
||||||
val uri = getUriForFilePath(path)
|
val uri = getUriForFilePath(path)
|
||||||
|
Reference in New Issue
Block a user