replacereplace a SparseIntArray appends with puts

This commit is contained in:
tibbi 2018-05-28 22:39:26 +02:00
parent 26f33e8c26
commit c521b33ed9
1 changed files with 6 additions and 5 deletions

View File

@ -29,10 +29,10 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
private val MAX_PREVIEW_HEIGHT = 1080
private val ORIENTATIONS = SparseIntArray().apply {
append(Surface.ROTATION_0, 90)
append(Surface.ROTATION_90, 0)
append(Surface.ROTATION_180, 270)
append(Surface.ROTATION_270, 180)
put(Surface.ROTATION_0, 90)
put(Surface.ROTATION_90, 0)
put(Surface.ROTATION_180, 270)
put(Surface.ROTATION_270, 180)
}
private lateinit var mActivity: MainActivity
@ -113,7 +113,8 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
throw RuntimeException("Time out waiting to lock camera opening.")
}
manager.openCamera(mCameraId, cameraStateCallback, mBackgroundHandler)
} catch (e: Exception) {
} catch (e: InterruptedException) {
} catch (e: SecurityException) {
}
}