Camera
Use android camera to take pictures and videos, based on camera2 api.
Features
- Auto filled
CameraView
for previewing - Support both image capture & video record
- Configurable audio/video size and aspect ratio, auto focus, tap to focus, flash control, pinch to zoom, etc.
Gradle
dependencies {
implementation 'com.github.duanhong169:camera:${latestVersion}'
...
}
Replace
${latestVersion}
with the latest version code. See releases.
Usage
- Add
CameraView
into your layout xml:
See
top_defaults_camera_attrs.xml
for all supported attributes.
- Create a
Photographer
with theCameraView
:
- Implement and set
Photographer.OnEventListener
to receive events from the camera:
- Start/stop preview in
onResume()
/onPause()
:
PhotographerHelper
is your friend:
See a complete usage in the app sample code.