mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
updating and removing some strings
This commit is contained in:
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user