aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-18 14:39:40 -0700
committerAllan Wang <me@allanwang.ca>2017-08-30 12:24:19 -0400
commita101b528efdee74fc1970b7f1fe68263f0b20269 (patch)
tree8fbd0fea544ec543cdf5ea2b74d81099d4ebd554 /core/src/main
parent9432652b03ae4d01e3dda4325984637d9523b9e2 (diff)
downloadkau-a101b528efdee74fc1970b7f1fe68263f0b20269.tar.gz
kau-a101b528efdee74fc1970b7f1fe68263f0b20269.tar.bz2
kau-a101b528efdee74fc1970b7f1fe68263f0b20269.zip
Create media picker action items (#40)
* Create action items * Increment version * Update camera action * Abstract camera action * Add and test * Refactor and add docs
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/utils/FileUtils.kt18
1 files changed, 0 insertions, 18 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/FileUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/FileUtils.kt
index 25e0519..b03707d 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/utils/FileUtils.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/utils/FileUtils.kt
@@ -11,23 +11,5 @@ import java.util.*
/**
* Created by Allan Wang on 2017-08-04.
*/
-@Throws(IOException::class)
-fun createMediaFile(prefix: String, extension: String): File {
- val timeStamp = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(Date())
- val imageFileName = "${prefix}_${timeStamp}_"
- val storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)
- val frostDir = File(storageDir, prefix)
- if (!frostDir.exists()) frostDir.mkdirs()
- return File.createTempFile(imageFileName, extension, frostDir)
-}
-
-@Throws(IOException::class)
-fun Context.createPrivateMediaFile(prefix: String, extension: String): File {
- val timeStamp = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(Date())
- val imageFileName = "${prefix}_${timeStamp}_"
- val storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES)
- return File.createTempFile(imageFileName, extension, storageDir)
-}
-
fun File.copyFromInputStream(inputStream: InputStream)
= inputStream.use { input -> outputStream().use { output -> input.copyTo(output) } } \ No newline at end of file