Skip to content

Commit

Permalink
v1.0.0-beta3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dwillmc committed Aug 17, 2018
1 parent c91c144 commit c330342
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {

subprojects { project ->
group = 'com.camerakit'
version = '1.0.0-beta3.1'
version = '1.0.0-beta3.2'

repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion camerakit/src/main/java/com/camerakit/CameraPreview.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import kotlin.math.absoluteValue
class CameraPreview : FrameLayout, CameraEvents {

companion object {
private const val FORCE_DEPRECATED_API = true
private const val FORCE_DEPRECATED_API = false
}

var listener: Listener? = null
Expand Down
7 changes: 4 additions & 3 deletions camerakit/src/main/java/com/camerakit/api/camera2/Camera2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,13 @@ class Camera2(eventsDelegate: CameraEvents, context: Context) :
}

private fun setFlashRequest(captureRequest: CaptureRequest.Builder) {
captureRequest.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF)
if (flash == CameraFlash.OFF) {
captureRequest.set(CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_AE_MODE_ON)
captureRequest.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF)
} else if (flash == CameraFlash.ON) {
captureRequest.set(CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH)
captureRequest.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE)
} else if (flash == CameraFlash.AUTO) {
captureRequest.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH)
captureRequest.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF)
}
}

Expand Down Expand Up @@ -182,6 +180,9 @@ class Camera2(eventsDelegate: CameraEvents, context: Context) :

captureBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE)
setFlashRequest(captureBuilder)
if (flash == CameraFlash.ON) {
captureBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE)
}

captureSession.stopRepeating()
captureSession.abortCaptures()
Expand Down

0 comments on commit c330342

Please sign in to comment.