public class CameraView extends ImgLyUIRelativeContainer implements Camera.OnStateChangeListener
| Modifier and Type | Class and Description |
|---|---|
static interface |
CameraView.CaptureCallback
Image capture callback.
|
static interface |
CameraView.OnSizeChangeListener
Size change callback.
|
static interface |
CameraView.Preview
Preview Surface callback.
|
| Constructor and Description |
|---|
CameraView(android.content.Context context) |
CameraView(android.content.Context context,
android.util.AttributeSet attrs) |
CameraView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
| Modifier and Type | Method and Description |
|---|---|
void |
capture(java.lang.String outputPath,
CameraView.CaptureCallback callback)
Take a Picture.
|
protected void |
dispatchDraw(android.graphics.Canvas canvas) |
CameraFacing |
getCameraFacing() |
FlashMode |
getFlashMode() |
CameraView.Preview |
getPreview() |
boolean |
hasSceneMode(java.lang.String mode) |
protected void |
onAttachedToUI(StateHandler stateHandler) |
protected void |
onAttachedToWindow() |
void |
onCamViewStateChange(Camera.CameraState state)
Will fire if Camera parameter state would change
|
protected void |
onDetachedFromUI(StateHandler stateHandler) |
protected void |
onDetachedFromWindow() |
void |
onOrientationChange(OrientationSensor.ScreenOrientation screenOrientation)
Would be set by the OrientationSensor Event.
|
void |
onPause()
Must be call on Activity Pause!
|
void |
onResume()
Can be call on Activity Resume
and start the preview.
|
void |
removePreview() |
CameraFacing |
setCameraFacing(CameraFacing cameraFacing) |
FlashMode |
setFlashMode(FlashMode mode) |
void |
setOnStateChangeListener(Camera.OnStateChangeListener onStateChangeListener) |
void |
setPreview(CameraView.Preview preview) |
SceneMode |
setSceneMode(SceneMode mode) |
void |
startPreview()
Start Preview manually
|
void |
stopPreview(boolean release)
Start Preview manually
|
public CameraView(android.content.Context context)
public CameraView(android.content.Context context,
android.util.AttributeSet attrs)
public CameraView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
public void onCamViewStateChange(Camera.CameraState state)
Camera.OnStateChangeListeneronCamViewStateChange in interface Camera.OnStateChangeListenerstate - Camera state
public void setOnStateChangeListener(Camera.OnStateChangeListener onStateChangeListener)
@Nullable public CameraView.Preview getPreview()
public void setPreview(CameraView.Preview preview)
public void removePreview()
public CameraFacing setCameraFacing(CameraFacing cameraFacing)
public void stopPreview(boolean release)
release - true if camera should be releaseGlContext.and #onPause()public void startPreview()
onResume()public CameraFacing getCameraFacing()
public FlashMode getFlashMode()
@Nullable public boolean hasSceneMode(java.lang.String mode)
public void onResume()
public void onPause()
public void capture(java.lang.String outputPath,
CameraView.CaptureCallback callback)
outputPath - output path the will save.callback - a callback when it's done.protected void onAttachedToUI(StateHandler stateHandler)
protected void onDetachedFromUI(StateHandler stateHandler)
protected void onAttachedToWindow()
protected void onDetachedFromWindow()
protected void dispatchDraw(@NonNull
android.graphics.Canvas canvas)
public void onOrientationChange(OrientationSensor.ScreenOrientation screenOrientation)
screenOrientation - Orientation set by Sensor.