Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Hi there, thank you for the question. We will add it to the work pipeline and get back to you.
co...@protonmail.com <co...@protonmail.com> #3
I think you can set the zoom ratio right after cameraController.bindToLifecycle(this)
This should achieve what you want.
jb...@google.com <jb...@google.com> #4
I've tried that as well, but didn't worked.
co...@protonmail.com <co...@protonmail.com> #5
co...@protonmail.com <co...@protonmail.com> #6
jb...@google.com <jb...@google.com> #7
Please try the the snippet below. It should work.
cameraController.getInitializationFuture().addListener({
cameraController.bindToLifecycle(activity)
cameraController.setZoomRatio(1.5f)
// The following codes are needed if you want to keep the zoom ratio 1.5x after stop/start the activity or fragment.
cameraController.cameraInfo!!.cameraState.removeObservers(activity)
cameraController.cameraInfo!!.cameraState.observe(activity) {
if (it.type == CameraState.Type.OPEN || it.type == CameraState.Type.OPEN) {
cameraController.setZoomRatio(1.5f)
}
}
}, ContextCompat.getMainExecutor(applicationContext))
+Xi to see if there is a better approach.
jb...@google.com <jb...@google.com>
co...@protonmail.com <co...@protonmail.com> #8
The above solution is working as expected. Thanks!
ma...@deutschebahn.com <ma...@deutschebahn.com> #9
Branch: androidx-main
commit 19a88266d210181cd3ee7fa742eebdb4d57a678b
Author: Xi Zhang <xizh@google.com>
Date: Wed Jan 04 10:38:27 2023
Cleanup: remove unused code in CameraController.
The Display object and the TapToFocusStates annotation are no longer used.
Bug: 264157663
Test: manual test and ./gradlew bOS
Change-Id: I4d20d52e6e0e7bac1ae5e7cce3d358f24800c024
M camera/camera-view/src/androidTest/java/androidx/camera/view/PreviewViewDeviceTest.kt
M camera/camera-view/src/main/java/androidx/camera/view/CameraController.java
M camera/camera-view/src/main/java/androidx/camera/view/PreviewView.java
cj...@gmail.com <cj...@gmail.com> #10
Branch: androidx-main
commit 0a95adb75d68ecc43e27640e913ee876193b9b09
Author: Xi Zhang <xizh@google.com>
Date: Wed Jan 04 11:49:16 2023
Cleanup: create a wrapper interface for ProcessCameraProvider for injecting dependencies in unit tests.
It's hard to fake ProcessCameraProvider in unit tests. This CL creates a wrapper interface for ProcessCameraProvider so that it can be faked. This allows us to test initialization related code with unit tests.
- Create a ProcessCameraProviderWrapper with all the methods needed by CameraController.
- Create a ProcessCameraProviderWrapperImpl that wraps the real object.
- Add two tests for delayed initialization.
Bug: 264157663
Test: manual test and ./gradlew bOS
Change-Id: I1848135d58550ee1f1628f50075fff73e42896e5
M camera/camera-view/src/main/java/androidx/camera/view/CameraController.java
M camera/camera-view/src/main/java/androidx/camera/view/LifecycleCameraController.java
A camera/camera-view/src/main/java/androidx/camera/view/ProcessCameraProviderWrapper.java
A camera/camera-view/src/main/java/androidx/camera/view/ProcessCameraProviderWrapperImpl.java
M camera/camera-view/src/test/java/androidx/camera/view/CameraControllerTest.kt
A camera/camera-view/src/test/java/androidx/camera/view/FakeProcessCameraProviderWrapper.kt
jb...@google.com <jb...@google.com> #11
Branch: androidx-main
commit 1bd96bc31127f262b206dcf15b3897b79dc5a039
Author: Xi Zhang <xizh@google.com>
Date: Fri Jan 06 09:58:01 2023
In CameraController, allow setting CameraControl values before init
Save pending values and wait for the init to complete before setting them.
- Create a PendingValue class. This represents a pending CameraControl value set before init.
- In CameraController, if setting CameraControl values before init, set the PendingValue instead.
- In CameraController, once init completes, propagate the pending values. If init/bindToLifecycle fails, no-op and continue to wait.
- Updated FakeCameraControl to track the latest zoom and torch values.
Relnote: when setting torch/zoom prior before camera initialization compelets, e.g. calling CameraController#enableTorch, the pending action is cached and submitted once the initialization compeltes.
Bug: 264157663
Test: manual test and ./gradlew bOS
Change-Id: I11e926246983a760b0e65652abe89c67f6434cff
M camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeCamera.java
M camera/camera-testing/src/main/java/androidx/camera/testing/fakes/FakeCameraControl.java
M camera/camera-view/src/main/java/androidx/camera/view/CameraController.java
A camera/camera-view/src/main/java/androidx/camera/view/PendingValue.java
M camera/camera-view/src/test/java/androidx/camera/view/CameraControllerTest.kt
M camera/camera-view/src/test/java/androidx/camera/view/FakeProcessCameraProviderWrapper.kt
A camera/camera-view/src/test/java/androidx/camera/view/PendingValueTest.kt
ma...@deutschebahn.com <ma...@deutschebahn.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.camera:camera-view:1.3.0-alpha03
do...@gmail.com <do...@gmail.com> #13
Just wanted to let know that the solution in
jb...@google.com <jb...@google.com> #14
Hi, I checked the above commits and you should do same for exposure controlling. Because it also affects while setting exposure initially.
Description
Component used: Navigation/SafeArgs Kotlin Version used:
2.4.0-rc01
AGP:7.1.0-rc01
Kotlin:1.6.10
When calling
gw :app:assembleDebug
I see the following error (plus stacktrace):Here's my plugins block in
app/b.g.kts
:Obviously the error message is incorrect -- KGP is invoked right there at the top 🤔
Happy to provide more info (Gradle Scan, other repo info) privately; just ping me!