diff --git a/library/src/main/api14/com/google/android/cameraview/Camera1.java b/library/src/main/api14/com/google/android/cameraview/Camera1.java index ad650dba..c3fd7295 100644 --- a/library/src/main/api14/com/google/android/cameraview/Camera1.java +++ b/library/src/main/api14/com/google/android/cameraview/Camera1.java @@ -45,7 +45,7 @@ class Camera1 extends CameraViewImpl { private int mCameraId; - private Camera mCamera; + Camera mCamera; private Camera.Parameters mCameraParameters; @@ -101,7 +101,7 @@ void stop() { } @SuppressLint("NewApi") // Suppresses Camera#setPreviewTexture - private void setUpPreview() { + void setUpPreview() { try { if (mPreview.getOutputClass() == SurfaceHolder.class) { final boolean needsToStopPreview = mShowingPreview && Build.VERSION.SDK_INT < 14; @@ -220,7 +220,7 @@ public void onAutoFocus(boolean success, Camera camera) { } } - private void takePictureInternal() { + void takePictureInternal() { mCamera.takePicture(null, null, null, new Camera.PictureCallback() { @Override public void onPictureTaken(byte[] data, Camera camera) { @@ -301,7 +301,7 @@ private AspectRatio chooseAspectRatio() { return r; } - private void adjustCameraParameters() { + void adjustCameraParameters() { SortedSet sizes = mPreviewSizes.sizes(mAspectRatio); if (sizes == null) { // Not supported mAspectRatio = chooseAspectRatio(); diff --git a/library/src/main/api14/com/google/android/cameraview/TextureViewPreview.java b/library/src/main/api14/com/google/android/cameraview/TextureViewPreview.java index d5def1a5..f2fa4492 100644 --- a/library/src/main/api14/com/google/android/cameraview/TextureViewPreview.java +++ b/library/src/main/api14/com/google/android/cameraview/TextureViewPreview.java @@ -106,7 +106,7 @@ boolean isReady() { * Configures the transform matrix for TextureView based on {@link #mDisplayOrientation} and * the surface size. */ - private void configureTransform() { + void configureTransform() { Matrix matrix = new Matrix(); if (mDisplayOrientation % 180 == 90) { final int width = getWidth(); diff --git a/library/src/main/api21/com/google/android/cameraview/Camera2.java b/library/src/main/api21/com/google/android/cameraview/Camera2.java index fa2813c2..c34bf842 100644 --- a/library/src/main/api21/com/google/android/cameraview/Camera2.java +++ b/library/src/main/api21/com/google/android/cameraview/Camera2.java @@ -118,7 +118,7 @@ public void onClosed(@NonNull CameraCaptureSession session) { }; - private PictureCaptureCallback mCaptureCallback = new PictureCaptureCallback() { + PictureCaptureCallback mCaptureCallback = new PictureCaptureCallback() { @Override public void onPrecaptureRequired() { @@ -164,11 +164,11 @@ public void onImageAvailable(ImageReader reader) { private CameraCharacteristics mCameraCharacteristics; - private CameraDevice mCamera; + CameraDevice mCamera; - private CameraCaptureSession mCaptureSession; + CameraCaptureSession mCaptureSession; - private CaptureRequest.Builder mPreviewRequestBuilder; + CaptureRequest.Builder mPreviewRequestBuilder; private ImageReader mImageReader; @@ -427,7 +427,7 @@ private void startOpeningCamera() { *

This rewrites {@link #mPreviewRequestBuilder}.

*

The result will be continuously processed in {@link #mSessionCallback}.

*/ - private void startCaptureSession() { + void startCaptureSession() { if (!isCameraOpened() || !mPreview.isReady()) { return; } @@ -474,7 +474,7 @@ private Size chooseOptimalSize() { /** * Updates the internal state of auto-focus to {@link #mAutoFocus}. */ - private void updateAutoFocus() { + void updateAutoFocus() { if (mAutoFocus) { int[] modes = mCameraCharacteristics.get( CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES); @@ -497,7 +497,7 @@ private void updateAutoFocus() { /** * Updates the internal state of flash to {@link #mFlash}. */ - private void updateFlash() { + void updateFlash() { switch (mFlash) { case Constants.FLASH_OFF: mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, @@ -549,7 +549,7 @@ private void lockFocus() { /** * Captures a still picture. */ - private void captureStillPicture() { + void captureStillPicture() { try { CaptureRequest.Builder captureRequestBuilder = mCamera.createCaptureRequest( CameraDevice.TEMPLATE_STILL_CAPTURE); @@ -610,7 +610,7 @@ public void onCaptureCompleted(@NonNull CameraCaptureSession session, * Unlocks the auto-focus and restart camera preview. This is supposed to be called after * capturing a still picture. */ - private void unlockFocus() { + void unlockFocus() { mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CaptureRequest.CONTROL_AF_TRIGGER_CANCEL); try { @@ -642,6 +642,9 @@ private static abstract class PictureCaptureCallback private int mState; + PictureCaptureCallback() { + } + void setState(int state) { mState = state; } diff --git a/library/src/main/api9/com/google/android/cameraview/SurfaceViewPreview.java b/library/src/main/api9/com/google/android/cameraview/SurfaceViewPreview.java index af6e8107..b3f81b74 100644 --- a/library/src/main/api9/com/google/android/cameraview/SurfaceViewPreview.java +++ b/library/src/main/api9/com/google/android/cameraview/SurfaceViewPreview.java @@ -26,7 +26,7 @@ class SurfaceViewPreview extends PreviewImpl { - private final SurfaceView mSurfaceView; + final SurfaceView mSurfaceView; SurfaceViewPreview(Context context, ViewGroup parent) { final View view = View.inflate(context, R.layout.surface_view, parent); diff --git a/library/src/main/java/com/google/android/cameraview/CameraView.java b/library/src/main/java/com/google/android/cameraview/CameraView.java index 28581403..3b3b06ce 100644 --- a/library/src/main/java/com/google/android/cameraview/CameraView.java +++ b/library/src/main/java/com/google/android/cameraview/CameraView.java @@ -69,7 +69,7 @@ public class CameraView extends FrameLayout { public @interface Flash { } - private final CameraViewImpl mImpl; + final CameraViewImpl mImpl; private final CallbackBridge mCallbacks; @@ -384,6 +384,9 @@ private class CallbackBridge implements CameraViewImpl.Callback { private boolean mRequestLayoutOnOpen; + CallbackBridge() { + } + public void add(Callback callback) { mCallbacks.add(callback); } diff --git a/library/src/main/java/com/google/android/cameraview/DisplayOrientationDetector.java b/library/src/main/java/com/google/android/cameraview/DisplayOrientationDetector.java index d33b473f..14f51685 100644 --- a/library/src/main/java/com/google/android/cameraview/DisplayOrientationDetector.java +++ b/library/src/main/java/com/google/android/cameraview/DisplayOrientationDetector.java @@ -31,7 +31,7 @@ abstract class DisplayOrientationDetector { private final OrientationEventListener mOrientationEventListener; /** Mapping from Surface.Rotation_n to degrees. */ - private static final SparseIntArray DISPLAY_ORIENTATIONS = new SparseIntArray(); + static final SparseIntArray DISPLAY_ORIENTATIONS = new SparseIntArray(); static { DISPLAY_ORIENTATIONS.put(Surface.ROTATION_0, 0); @@ -40,7 +40,7 @@ abstract class DisplayOrientationDetector { DISPLAY_ORIENTATIONS.put(Surface.ROTATION_270, 270); } - private Display mDisplay; + Display mDisplay; private int mLastKnownDisplayOrientation = 0; @@ -81,7 +81,7 @@ public int getLastKnownDisplayOrientation() { return mLastKnownDisplayOrientation; } - private void dispatchOnDisplayOrientationChanged(int displayOrientation) { + void dispatchOnDisplayOrientationChanged(int displayOrientation) { mLastKnownDisplayOrientation = displayOrientation; onDisplayOrientationChanged(displayOrientation); }