Rename captureImage to capturePicture for consistency

pull/1/head
Mattia Iavarone 7 years ago
parent 5198c259cd
commit 7f131c4cf9
  1. 6
      camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java
  2. 2
      camerakit/src/main/api21/com/flurgle/camerakit/Camera2.java
  3. 2
      camerakit/src/main/base/com/flurgle/camerakit/CameraImpl.java
  4. 10
      camerakit/src/main/java/com/flurgle/camerakit/CameraView.java
  5. 2
      demo/src/main/java/com/flurgle/camerakit/demo/MainActivity.java

@ -363,7 +363,7 @@ class Camera1 extends CameraImpl {
}
@Override
void captureImage() {
void capturePicture() {
if (mIsCapturingImage) return;
if (!isCameraOpened()) return;
if (mSessionType == SESSION_TYPE_VIDEO && mIsCapturingVideo) {
@ -403,9 +403,9 @@ class Camera1 extends CameraImpl {
if (!isCameraOpened()) return;
if (mIsCapturingImage) return;
// This won't work while capturing a video.
// Switch to captureImage.
// Switch to capturePicture.
if (mIsCapturingVideo) {
captureImage();
capturePicture();
return;
}
mIsCapturingImage = true;

@ -178,7 +178,7 @@ class Camera2 extends CameraImpl {
}
@Override
void captureImage() {
void capturePicture() {
}

@ -32,7 +32,7 @@ abstract class CameraImpl implements PreviewImpl.SurfaceCallback {
abstract void setSessionType(@SessionType int sessionType);
abstract void setLocation(double latitude, double longitude);
abstract void captureImage();
abstract void capturePicture();
abstract void captureSnapshot();
abstract void startVideo(@NonNull File file);
abstract void endVideo();

@ -664,7 +664,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver {
* Set the current session type to either picture or video.
* When sessionType is video,
* - {@link #startCapturingVideo(File)} will not throw any exception
* - {@link #captureImage()} will fallback to {@link #captureSnapshot()}
* - {@link #capturePicture()} will fallback to {@link #captureSnapshot()}
*
* @see CameraKit.Constants#SESSION_TYPE_PICTURE
* @see CameraKit.Constants#SESSION_TYPE_VIDEO
@ -808,8 +808,8 @@ public class CameraView extends FrameLayout implements LifecycleObserver {
*
* @see #captureSnapshot()
*/
public void captureImage() {
mCameraImpl.captureImage();
public void capturePicture() {
mCameraImpl.capturePicture();
}
@ -818,10 +818,10 @@ public class CameraView extends FrameLayout implements LifecycleObserver {
* This eventually triggers {@link CameraListener#onPictureTaken(byte[])} if a listener
* was registered.
*
* The difference with {@link #captureImage()} is that this capture is faster, so it might be
* The difference with {@link #capturePicture()} is that this capture is faster, so it might be
* better on slower cameras, though the result can be generally blurry or low quality.
*
* @see #captureImage()
* @see #capturePicture()
*/
public void captureSnapshot() {
mCameraImpl.captureSnapshot();

@ -139,7 +139,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLayoutChan
}
};
camera.addCameraListener(mPictureListener);
camera.captureImage();
camera.capturePicture();
}
@OnClick(R.id.captureVideo)

Loading…
Cancel
Save