Bug/save to capture when app goes on pause (#1578)

* add scan support for landscape mode

* refactoring

* fix errors

* fix rotation

* add landscape orientation support

* fix exception

* freeze preview image

From PR https://github.com/lwansbrough/react-native-camera/pull/919

* fix bug on android when user take photo and press home button immediately - after that camera not works
This commit is contained in:
Slavik 2018-05-22 19:38:42 +03:00 committed by Sibelius Seraphini
parent f3a973bc31
commit 60b9ef1b84
2 changed files with 3 additions and 3 deletions

View File

@ -818,7 +818,7 @@ public class RCTCameraModule extends ReactContextBaseJavaModule
*/ */
@Override @Override
public void onHostResume() { public void onHostResume() {
// ... do nothing mSafeToCapture = true;
} }
@Override @Override

View File

@ -397,7 +397,7 @@ class RCTCameraViewFinder extends TextureView implements TextureView.SurfaceText
resultPoints.pushMap(newPoint); resultPoints.pushMap(newPoint);
} }
} }
event.putArray("bounds", resultPoints); event.putArray("bounds", resultPoints);
event.putString("data", result.getText()); event.putString("data", result.getText());
event.putString("type", result.getBarcodeFormat().toString()); event.putString("type", result.getBarcodeFormat().toString());
@ -528,4 +528,4 @@ class RCTCameraViewFinder extends TextureView implements TextureView.SurfaceText
float y = event.getY(0) - event.getY(1); float y = event.getY(0) - event.getY(1);
return (float) Math.sqrt(x * x + y * y); return (float) Math.sqrt(x * x + y * y);
} }
} }