优化细节
This commit is contained in:
@@ -242,6 +242,7 @@ public class CaptureHelper implements CaptureLifecycle,CaptureTouchEvent,Capture
|
|||||||
public void onPause(){
|
public void onPause(){
|
||||||
if (captureHandler != null) {
|
if (captureHandler != null) {
|
||||||
captureHandler.quitSynchronously();
|
captureHandler.quitSynchronously();
|
||||||
|
captureHandler = null;
|
||||||
}
|
}
|
||||||
inactivityTimer.onPause();
|
inactivityTimer.onPause();
|
||||||
ambientLightManager.stop();
|
ambientLightManager.stop();
|
||||||
@@ -526,16 +527,18 @@ public class CaptureHelper implements CaptureLifecycle,CaptureTouchEvent,Capture
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isPlayBeep){//如果播放音效,则稍微延迟一点,给予播放音效时间
|
if(isPlayBeep){//如果播放音效,则稍微延迟一点,给予播放音效时间
|
||||||
captureHandler.postDelayed(() -> {
|
if(captureHandler != null){
|
||||||
//如果设置了回调,并且onCallback返回为true,则表示拦截
|
captureHandler.postDelayed(() -> {
|
||||||
if(onCaptureCallback!=null && onCaptureCallback.onResultCallback(text)){
|
//如果设置了回调,并且onCallback返回为true,则表示拦截
|
||||||
return;
|
if(onCaptureCallback!=null && onCaptureCallback.onResultCallback(text)){
|
||||||
}
|
return;
|
||||||
Intent intent = new Intent();
|
}
|
||||||
intent.putExtra(Intents.Scan.RESULT,text);
|
Intent intent = new Intent();
|
||||||
activity.setResult(Activity.RESULT_OK,intent);
|
intent.putExtra(Intents.Scan.RESULT,text);
|
||||||
activity.finish();
|
activity.setResult(Activity.RESULT_OK,intent);
|
||||||
},100);
|
activity.finish();
|
||||||
|
},100);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user