fix #86
This commit is contained in:
@@ -22,7 +22,6 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.hardware.Camera;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
@@ -526,19 +525,18 @@ public class CaptureHelper implements CaptureLifecycle,CaptureTouchEvent,Capture
|
||||
return;
|
||||
}
|
||||
|
||||
if(isPlayBeep){//如果播放音效,则稍微延迟一点,给予播放音效时间
|
||||
if(captureHandler != null){
|
||||
captureHandler.postDelayed(() -> {
|
||||
//如果设置了回调,并且onCallback返回为true,则表示拦截
|
||||
if(onCaptureCallback!=null && onCaptureCallback.onResultCallback(text)){
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(Intents.Scan.RESULT,text);
|
||||
activity.setResult(Activity.RESULT_OK,intent);
|
||||
activity.finish();
|
||||
},100);
|
||||
}
|
||||
if(isPlayBeep && captureHandler != null){//如果播放音效,则稍微延迟一点,给予播放音效时间
|
||||
captureHandler.postDelayed(() -> {
|
||||
//如果设置了回调,并且onCallback返回为true,则表示拦截
|
||||
if(onCaptureCallback!=null && onCaptureCallback.onResultCallback(text)){
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(Intents.Scan.RESULT,text);
|
||||
activity.setResult(Activity.RESULT_OK,intent);
|
||||
activity.finish();
|
||||
},100);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user