Ejemplo n.º 1
0
  @Kroll.method
  public void switchCamera(int whichCamera) {
    TiCameraActivity activity = TiCameraActivity.cameraActivity;

    if (activity == null || !activity.isPreviewRunning()) {
      Log.e(TAG, "Camera preview is not open, unable to switch camera.");
      return;
    }

    activity.switchCamera(whichCamera);
  }
Ejemplo n.º 2
0
 @Kroll.method
 public void takePicture() {
   // make sure the preview / camera are open before trying to take photo
   if (TiCameraActivity.cameraActivity != null) {
     TiCameraActivity.takePicture();
   } else {
     Log.e(TAG, "Camera preview is not open, unable to take photo");
   }
 }
Ejemplo n.º 3
0
 @Kroll.method
 public void hideCamera() {
   // make sure the preview / camera are open before trying to hide
   if (TiCameraActivity.cameraActivity != null) {
     TiCameraActivity.hide();
   } else {
     Log.e(TAG, "Camera preview is not open, unable to hide");
   }
 }