updating and removing some strings

This commit is contained in:
tibbi
2017-09-20 23:52:48 +02:00
parent 612a6918b7
commit d854e5d94c
15 changed files with 16 additions and 55 deletions

View File

@ -15,6 +15,7 @@ import com.simplemobiletools.camera.extensions.getOutputMediaFile
import com.simplemobiletools.camera.extensions.getPreviewRotation
import com.simplemobiletools.commons.extensions.getFileDocument
import com.simplemobiletools.commons.extensions.needsStupidWritePermissions
import com.simplemobiletools.commons.extensions.showErrorToast
import com.simplemobiletools.commons.extensions.toast
import java.io.File
import java.io.FileOutputStream
@ -50,9 +51,7 @@ class PhotoProcessor(val activity: MainActivity, val uri: Uri?, val currCameraId
val photoFile = File(path)
if (activity.needsStupidWritePermissions(path)) {
if (activity.config.treeUri.isEmpty()) {
activity.runOnUiThread {
activity.toast(R.string.save_error_internal_storage)
}
activity.toast(R.string.save_error_internal_storage)
activity.config.savePhotosFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).toString()
return ""
}
@ -104,10 +103,7 @@ class PhotoProcessor(val activity: MainActivity, val uri: Uri?, val currCameraId
try {
return Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true)
} catch (e: OutOfMemoryError) {
Log.e(TAG, "PhotoProcessor rotate OutOfMemoryError $e")
activity.runOnUiThread {
activity.toast(R.string.photo_not_saved)
}
activity.showErrorToast(e.toString())
}
return null
}

View File

@ -633,7 +633,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
}
private fun setupFailed(e: Exception) {
mActivity.toast(R.string.video_setup_error)
mActivity.showErrorToast(e)
Log.e(TAG, "initRecorder " + e.message)
releaseCamera()
}
@ -669,7 +669,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
toggleShutterSound(false)
mIsRecording = true
} catch (e: Exception) {
mActivity.toast(R.string.video_setup_error)
mActivity.showErrorToast(e)
Log.e(TAG, "toggleRecording " + e.message)
releaseCamera()
}
@ -684,7 +684,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
} catch (e: RuntimeException) {
toggleShutterSound(false)
File(mCurrVideoPath).delete()
mActivity.toast(R.string.video_saving_error)
mActivity.showErrorToast(e)
Log.e(TAG, "stopRecording " + e.message)
mRecorder = null
mIsRecording = false