File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
fotoapparat/src/main/java/io/fotoapparat Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ repositories {
166166 maven { url 'https://jitpack.io' }
167167}
168168
169- compile 'io.fotoapparat.fotoapparat:library:2.0.1 '
169+ compile 'io.fotoapparat.fotoapparat:library:2.0.2 '
170170```
171171
172172Camera permission will be automatically added to your ` AndroidManifest.xml ` . Do not forget to request this permission on Marshmallow and higher.
Original file line number Diff line number Diff line change 1+ package io.fotoapparat.exception.camera
2+
3+ /* *
4+ * Thrown when the preview surface didn't become available.
5+ */
6+ class UnavailableSurfaceException : CameraException (
7+ " No preview surface became available before CameraView got detached from window. " +
8+ " Camera didn't start. You may ignore this exception."
9+ )
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import android.util.AttributeSet
66import android.view.TextureView
77import android.view.ViewGroup
88import android.widget.FrameLayout
9+ import io.fotoapparat.exception.camera.UnavailableSurfaceException
910import io.fotoapparat.parameter.Resolution
1011import io.fotoapparat.parameter.ScaleType
1112import java.util.concurrent.CountDownLatch
@@ -63,7 +64,7 @@ class CameraView
6364
6465 private fun getPreviewAfterLatch (): Preview .Texture {
6566 textureLatch.await()
66- return surfaceTexture?.toPreview() ? : throw InterruptedException ( " No surface became available. " )
67+ return surfaceTexture?.toPreview() ? : throw UnavailableSurfaceException ( )
6768 }
6869
6970 private fun TextureView.tryInitialize () = surfaceTexture ? : null .also {
@@ -75,7 +76,6 @@ class CameraView
7576
7677}
7778
78-
7979private fun ViewGroup.layoutTextureView (
8080 previewResolution : Resolution ? ,
8181 scaleType : ScaleType ?
You can’t perform that action at this time.
0 commit comments