public class

CameraTouchHelper

extends Object
java.lang.Object
   ↳ org.opencdnunion.media.streamer.capture.camera.CameraTouchHelper

Class Overview

Handle touch events for camera view.

Summary

Nested Classes
interface CameraTouchHelper.OnTouchListener  
Public Constructors
CameraTouchHelper()
Public Methods
synchronized void addTouchListener(CameraTouchHelper.OnTouchListener touchListener)
boolean onTouch(View view, MotionEvent event)
synchronized void removeAllTouchListener()
synchronized void removeTouchListener(CameraTouchHelper.OnTouchListener touchListener)
void setCameraCapture(CameraCapture cameraCapture)
Set CameraCapture instance, without whom touch focus and zoom would not work.
void setCameraHintView(ICameraHintView view)
Set a CameraHintView to show touch focus status and zoom value.
void setEnableTouchFocus(boolean enableTouchFocus)
Enable touch focus or not.
void setEnableZoom(boolean enableZoom)
Enable zoom camera with gestures or not.
void setFocusAreaRadius(float radius)
Set radius of focus square, relative to the short edge of preview view.
void setMaxZoomRatio(float maxZoomRatio)
Set max zoom value, will use the smaller one between the set value and max zoom value that hardware supported.
void setRefocusDelay(int delay)
Set delay time to reset to previous focus mode after touch focused.
void setZoomSpeed(float zoomSpeed)
Set zoom in/out speed while using scale gestures.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CameraTouchHelper ()

Public Methods

public synchronized void addTouchListener (CameraTouchHelper.OnTouchListener touchListener)

public boolean onTouch (View view, MotionEvent event)

public synchronized void removeAllTouchListener ()

public synchronized void removeTouchListener (CameraTouchHelper.OnTouchListener touchListener)

public void setCameraCapture (CameraCapture cameraCapture)

Set CameraCapture instance, without whom touch focus and zoom would not work.

Parameters
cameraCapture CameraCapture instance to set

public void setCameraHintView (ICameraHintView view)

Set a CameraHintView to show touch focus status and zoom value.

Parameters
view view implements ICameraHintView

public void setEnableTouchFocus (boolean enableTouchFocus)

Enable touch focus or not. Default enabled.

Parameters
enableTouchFocus true to enable, false to disable

public void setEnableZoom (boolean enableZoom)

Enable zoom camera with gestures or not. Default enabled.

Parameters
enableZoom true to enable, false to disable

public void setFocusAreaRadius (float radius)

Set radius of focus square, relative to the short edge of preview view.
The default value is 0.083.

Parameters
radius must be 0-0.5, or exception occur.
Throws
IllegalArgumentException

public void setMaxZoomRatio (float maxZoomRatio)

Set max zoom value, will use the smaller one between the set value and max zoom value that hardware supported.
The default value is 4.0f.

Parameters
maxZoomRatio value that bigger than 1.0f, 1.0 means no zoom.

public void setRefocusDelay (int delay)

Set delay time to reset to previous focus mode after touch focused.
The default value is 5000.

Parameters
delay delay time in milliseconds, 0 or negative value means never.

public void setZoomSpeed (float zoomSpeed)

Set zoom in/out speed while using scale gestures.

Parameters
zoomSpeed valid in 0.1f~10.f, default 1.0f.