mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-24 14:58:13 +08:00
Store temporary files created for Camera in the media folder.
This commit is contained in:
parent
53734255ec
commit
8f9695a9a8
1
changelog.d/+picker.bugfix
Normal file
1
changelog.d/+picker.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Store temporary files created for Camera in the media folder.
|
@ -24,7 +24,7 @@ import java.util.Locale
|
|||||||
|
|
||||||
internal fun createTemporaryMediaFile(context: Context, mediaType: MediaType): File {
|
internal fun createTemporaryMediaFile(context: Context, mediaType: MediaType): File {
|
||||||
val timeStamp: String = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(Date())
|
val timeStamp: String = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(Date())
|
||||||
val storageDir: File = context.filesDir.also { it.mkdirs() }
|
val storageDir: File = File(context.filesDir, "media").also { it.mkdirs() }
|
||||||
val fileSuffix = when (mediaType) {
|
val fileSuffix = when (mediaType) {
|
||||||
MediaType.IMAGE -> ".jpg"
|
MediaType.IMAGE -> ".jpg"
|
||||||
MediaType.VIDEO -> ".mp4"
|
MediaType.VIDEO -> ".mp4"
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
<paths>
|
<paths>
|
||||||
<files-path
|
<files-path
|
||||||
name="external_files"
|
name="external_files"
|
||||||
path="." />
|
path="media" />
|
||||||
</paths>
|
</paths>
|
Loading…
Reference in New Issue
Block a user