From 502dae5205194708757226117524b1a03b479d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=A2=96?= Date: Thu, 28 Dec 2023 19:43:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=8B=8D=E7=85=A7?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=BF=AB=E9=80=9F=E8=BF=9E=E7=BB=AD=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=AF=BC=E8=87=B4=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tuichat/component/camera/state/PreviewState.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Android/TUIKit/TUIChat/tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/component/camera/state/PreviewState.java b/Android/TUIKit/TUIChat/tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/component/camera/state/PreviewState.java index af0c6fb525e..c9cbfe87e6e 100644 --- a/Android/TUIKit/TUIChat/tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/component/camera/state/PreviewState.java +++ b/Android/TUIKit/TUIChat/tuichat/src/main/java/com/tencent/qcloud/tuikit/tuichat/component/camera/state/PreviewState.java @@ -12,6 +12,7 @@ class PreviewState implements State { public static final String TAG = "PreviewState"; private CameraMachine machine; + private boolean capturing = false; PreviewState(CameraMachine machine) { this.machine = machine; @@ -46,6 +47,12 @@ public void switchCamera(SurfaceHolder holder, float screenProp) { @Override public void capture() { TUIChatLog.i(TAG, "capture"); + + if (capturing) { + return; + } + + capturing = true; CameraInterface.getInstance().takePicture(new CameraInterface.TakePictureCallback() { @Override public void captureResult(Bitmap bitmap, boolean isVertical) { @@ -57,6 +64,7 @@ public void captureResult(Bitmap bitmap, boolean isVertical) { machine.getCameraView().showPicture(bitmap, isVertical); machine.getBrowserPictureState().setDataPath(path); machine.setState(machine.getBrowserPictureState()); + capturing = false; } }); }