org.cyberlab.local.activity
Class Preview
java.lang.Object
ViewGroup
org.cyberlab.local.activity.Preview
class Preview
- extends ViewGroup
A simple wrapper around a Camera and a SurfaceView that renders a centered preview of the Camera
to the surface. We need to center the SurfaceView because not all devices have cameras that
support preview sizes at the same aspect ratio as the device's display.
Constructor Summary |
Preview(Context context)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mSurfaceView
SurfaceView mSurfaceView
mHolder
SurfaceHolder mHolder
mPreviewSize
Size mPreviewSize
mSupportedPreviewSizes
java.util.List<Size> mSupportedPreviewSizes
mCamera
Camera mCamera
Preview
Preview(Context context)
setCamera
public void setCamera(Camera camera)
switchCamera
public void switchCamera(Camera camera)
onMeasure
protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
onLayout
protected void onLayout(boolean changed,
int l,
int t,
int r,
int b)
surfaceCreated
public void surfaceCreated(SurfaceHolder holder)
surfaceDestroyed
public void surfaceDestroyed(SurfaceHolder holder)
surfaceChanged
public void surfaceChanged(SurfaceHolder holder,
int format,
int w,
int h)