@capgo/camera-preview 7.13.0 → 7.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1905,14 +1905,15 @@ public class CameraXView implements LifecycleOwner, LifecycleObserver {
|
|
|
1905
1905
|
.build();
|
|
1906
1906
|
|
|
1907
1907
|
try {
|
|
1908
|
-
|
|
1908
|
+
final ListenableFuture<FocusMeteringResult> future = camera
|
|
1909
1909
|
.getCameraControl()
|
|
1910
1910
|
.startFocusAndMetering(action);
|
|
1911
|
+
currentFocusFuture = future;
|
|
1911
1912
|
|
|
1912
|
-
|
|
1913
|
+
future.addListener(
|
|
1913
1914
|
() -> {
|
|
1914
1915
|
try {
|
|
1915
|
-
FocusMeteringResult result =
|
|
1916
|
+
FocusMeteringResult result = future.get();
|
|
1916
1917
|
} catch (Exception e) {
|
|
1917
1918
|
// Handle cancellation gracefully - this is expected when rapid taps occur
|
|
1918
1919
|
if (
|
|
@@ -1934,8 +1935,7 @@ public class CameraXView implements LifecycleOwner, LifecycleObserver {
|
|
|
1934
1935
|
Log.e(TAG, "Error during focus: " + e.getMessage());
|
|
1935
1936
|
}
|
|
1936
1937
|
} finally {
|
|
1937
|
-
|
|
1938
|
-
if (currentFocusFuture != null && currentFocusFuture.isDone()) {
|
|
1938
|
+
if (currentFocusFuture == future && currentFocusFuture.isDone()) {
|
|
1939
1939
|
currentFocusFuture = null;
|
|
1940
1940
|
}
|
|
1941
1941
|
}
|
|
@@ -2298,7 +2298,7 @@ public class CameraXView implements LifecycleOwner, LifecycleObserver {
|
|
|
2298
2298
|
try {
|
|
2299
2299
|
// For static method, we can return common flash modes
|
|
2300
2300
|
// Most modern cameras support these modes
|
|
2301
|
-
return Arrays.asList("off", "on", "auto");
|
|
2301
|
+
return Arrays.asList("off", "on", "auto", "torch");
|
|
2302
2302
|
} catch (Exception e) {
|
|
2303
2303
|
Log.e(TAG, "getSupportedFlashModesStatic: Error getting flash modes", e);
|
|
2304
2304
|
return Collections.singletonList("off");
|