-
- All Implemented Interfaces:
-
net.gini.android.capture.internal.camera.api.CameraInterface
public class OldCameraController implements CameraInterface
Internal use only.
-
-
Constructor Summary
Constructors Constructor Description OldCameraController(Activity activity)
-
Method Summary
Modifier and Type Method Description CompletableFuture<Void>open()Opens the first back-facing camera. voidclose()Closes the camera. CompletableFuture<Void>startPreview()Starts the camera preview. voidstopPreview()Stops the camera preview. booleanisPreviewRunning()Get the state of the preview. voidenableTapToFocus(@Nullable() CameraInterface.TapToFocusListener listener)Enables tap-to-focus using the given view by adding touch handling to it and transforming the touch point coordinatesto the camera sensor's coordinate system. voiddisableTapToFocus()Disables tap-to-focus. CompletableFuture<Boolean>focus()Start a focus run. CompletableFuture<Photo>takePicture()Take a picture with the camera. voidsetPreviewCallback(@Nullable() CameraInterface.PreviewCallback previewCallback)Set a callback to recieve preview images from the camera. ViewgetPreviewView(@NonNull() Context context)The view which shows the camera preview. booleanisFlashAvailable()booleanisFlashEnabled()voidsetFlashEnabled(boolean enabled)-
-
Constructor Detail
-
OldCameraController
OldCameraController(Activity activity)
-
-
Method Detail
-
close
void close()
Closes the camera.
-
startPreview
@NonNull() CompletableFuture<Void> startPreview()
Starts the camera preview.
-
stopPreview
void stopPreview()
Stops the camera preview.
-
isPreviewRunning
boolean isPreviewRunning()
Get the state of the preview.
-
enableTapToFocus
void enableTapToFocus(@Nullable() CameraInterface.TapToFocusListener listener)
Enables tap-to-focus using the given view by adding touch handling to it and transforming the touch point coordinatesto the camera sensor's coordinate system.
Note: the view should have the same size as the camera preview and be above it. You could also set thecamera preview android.view.SurfaceView directly as the tap view..
- Parameters:
listener- the listener for tap to focus events
-
disableTapToFocus
void disableTapToFocus()
Disables tap-to-focus.
-
takePicture
@NonNull() CompletableFuture<Photo> takePicture()
Take a picture with the camera.
-
setPreviewCallback
void setPreviewCallback(@Nullable() CameraInterface.PreviewCallback previewCallback)
Set a callback to recieve preview images from the camera.
- Parameters:
previewCallback- callback implementation
-
getPreviewView
View getPreviewView(@NonNull() Context context)
The view which shows the camera preview.
- Parameters:
context- Android context
-
isFlashAvailable
boolean isFlashAvailable()
-
isFlashEnabled
boolean isFlashEnabled()
-
setFlashEnabled
void setFlashEnabled(boolean enabled)
-
-
-
-