let the user know if the photo wasnt saved because he quit too early
This commit is contained in:
parent
811cfbf668
commit
048dbffd03
|
@ -61,6 +61,8 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
|||
private var mIsFocusing = false
|
||||
private var autoFocusHandler = Handler()
|
||||
|
||||
var isWaitingForTakePictureCallback = false
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(activity: MainActivity, surfaceView: SurfaceView, previewListener: PreviewListener) : super(activity) {
|
||||
|
@ -275,6 +277,15 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
|||
val selectedResolution = getSelectedResolution()
|
||||
mParameters!!.setPictureSize(selectedResolution.width, selectedResolution.height);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
mCamera!!.enableShutterSound(false)
|
||||
}
|
||||
|
||||
mRotationAtCapture = MainActivity.mLastHandledOrientation
|
||||
mCamera!!.parameters = mParameters
|
||||
isWaitingForTakePictureCallback = true
|
||||
mCamera!!.takePicture(null, null, takePictureCallback)
|
||||
|
||||
if (config.isSoundEnabled) {
|
||||
val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
val volume = audioManager.getStreamVolume(AudioManager.STREAM_SYSTEM)
|
||||
|
@ -283,20 +294,13 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
|||
mp?.start()
|
||||
}
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
mCamera!!.enableShutterSound(false)
|
||||
}
|
||||
|
||||
mRotationAtCapture = MainActivity.mLastHandledOrientation
|
||||
mCamera!!.parameters = mParameters
|
||||
mCamera!!.takePicture(null, null, takePictureCallback)
|
||||
}
|
||||
mCanTakePicture = false
|
||||
mIsFocusing = false
|
||||
}
|
||||
|
||||
private val takePictureCallback = Camera.PictureCallback { data, cam ->
|
||||
isWaitingForTakePictureCallback = false
|
||||
if (config.isShowPreviewEnabled) {
|
||||
mIsPreviewShown = true
|
||||
if (!config.wasPhotoPreviewHintShown) {
|
||||
|
|
|
@ -501,6 +501,10 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
|
|||
hideTimer()
|
||||
mPreview?.releaseCamera()
|
||||
mOrientationEventListener.disable()
|
||||
|
||||
if (mPreview?.isWaitingForTakePictureCallback == true) {
|
||||
toast(R.string.photo_not_saved)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupOrientationEventListener() {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">Wir benötigen Zugriff auf das Mirkofon um Videos aufnehmen zu können</string>
|
||||
<string name="no_gallery_app_available">Keine Galerie App verfügbar</string>
|
||||
<string name="click_to_resume_preview">Click on the image to resume preview</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">other</string>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">Se necesita el permiso de micrófono para grabar vídeos</string>
|
||||
<string name="no_gallery_app_available">No hay disponible una aplicación de galería</string>
|
||||
<string name="click_to_resume_preview">Haga clic en la imagen para reanudar la vista previa</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">otro</string>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">Nous avons besoin de l\'autorisation sur l\'audio pour enregistrer des vidéos</string>
|
||||
<string name="no_gallery_app_available">Pas d\'application album disponible</string>
|
||||
<string name="click_to_resume_preview">Click on the image to resume preview</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">other</string>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">È necessario l\'accesso al microfono per registrare i video</string>
|
||||
<string name="no_gallery_app_available">Nessuna app galleria disponibile</string>
|
||||
<string name="click_to_resume_preview">Click on the image to resume preview</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">other</string>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">ビデオを記録するためにオーディオのアクセス許可が必要です</string>
|
||||
<string name="no_gallery_app_available">利用可能なギャラリーアプリがありません</string>
|
||||
<string name="click_to_resume_preview">Click on the image to resume preview</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">other</string>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">Mums reikia audio leidimo, kad įrašyti vaizdo bylas</string>
|
||||
<string name="no_gallery_app_available">Nėra galerijos programėlės</string>
|
||||
<string name="click_to_resume_preview">Click on the image to resume preview</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">other</string>
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<string name="no_audio_permissions">Toestemming voor audio nodig is voor het opnemen van video\'s</string>
|
||||
<string name="no_gallery_app_available">Geen gallery app beschikbaar</string>
|
||||
<string name="click_to_resume_preview">Click on the image to resume preview</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">Ander</string>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">Necessitamos da permissão de áudio para gravar os vídeos</string>
|
||||
<string name="no_gallery_app_available">Nenhum aplicativo de galeria disponível</string>
|
||||
<string name="click_to_resume_preview">Click on the image to resume preview</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">outra</string>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">Necessitamos da permissão de áudio para gravar os vídeos</string>
|
||||
<string name="no_gallery_app_available">Nenhuma aplicação de galeria disponível</string>
|
||||
<string name="click_to_resume_preview">Clique na imagem para continuar com a pré-visualização</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">outra</string>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">Нам нужно аудио разрешение для записи видео</string>
|
||||
<string name="no_gallery_app_available">Нет доступного приложения-галереи</string>
|
||||
<string name="click_to_resume_preview">Click on the image to resume preview</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">другое</string>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">För att spela in video krävs ljudrättigheter</string>
|
||||
<string name="no_gallery_app_available">Ingen galleri-app finns tillgänglig</string>
|
||||
<string name="click_to_resume_preview">Click on the image to resume preview</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">other</string>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<string name="no_audio_permissions">We need audio permission for recording videos</string>
|
||||
<string name="no_gallery_app_available">No gallery app available</string>
|
||||
<string name="click_to_resume_preview">Click on the image to resume preview</string>
|
||||
<string name="photo_not_saved">The photo could not be saved</string>
|
||||
|
||||
<!-- other aspect ratio -->
|
||||
<string name="other">other</string>
|
||||
|
|
Loading…
Reference in New Issue