|
|
@ -20,6 +20,7 @@ import android.media.MediaActionSound; |
|
|
|
import android.os.Build; |
|
|
|
import android.os.Build; |
|
|
|
import android.os.Handler; |
|
|
|
import android.os.Handler; |
|
|
|
import android.os.Looper; |
|
|
|
import android.os.Looper; |
|
|
|
|
|
|
|
import android.support.annotation.ColorInt; |
|
|
|
import android.support.annotation.NonNull; |
|
|
|
import android.support.annotation.NonNull; |
|
|
|
import android.support.annotation.Nullable; |
|
|
|
import android.support.annotation.Nullable; |
|
|
|
import android.util.AttributeSet; |
|
|
|
import android.util.AttributeSet; |
|
|
@ -102,6 +103,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
Facing facing = Facing.fromValue(a.getInteger(R.styleable.CameraView_cameraFacing, Facing.DEFAULT(context).value())); |
|
|
|
Facing facing = Facing.fromValue(a.getInteger(R.styleable.CameraView_cameraFacing, Facing.DEFAULT(context).value())); |
|
|
|
Flash flash = Flash.fromValue(a.getInteger(R.styleable.CameraView_cameraFlash, Flash.DEFAULT.value())); |
|
|
|
Flash flash = Flash.fromValue(a.getInteger(R.styleable.CameraView_cameraFlash, Flash.DEFAULT.value())); |
|
|
|
Grid grid = Grid.fromValue(a.getInteger(R.styleable.CameraView_cameraGrid, Grid.DEFAULT.value())); |
|
|
|
Grid grid = Grid.fromValue(a.getInteger(R.styleable.CameraView_cameraGrid, Grid.DEFAULT.value())); |
|
|
|
|
|
|
|
int gridColor = a.getColor(R.styleable.CameraView_cameraGrid, GridLinesLayout.DEFAULT_COLOR); |
|
|
|
WhiteBalance whiteBalance = WhiteBalance.fromValue(a.getInteger(R.styleable.CameraView_cameraWhiteBalance, WhiteBalance.DEFAULT.value())); |
|
|
|
WhiteBalance whiteBalance = WhiteBalance.fromValue(a.getInteger(R.styleable.CameraView_cameraWhiteBalance, WhiteBalance.DEFAULT.value())); |
|
|
|
Mode mode = Mode.fromValue(a.getInteger(R.styleable.CameraView_cameraMode, Mode.DEFAULT.value())); |
|
|
|
Mode mode = Mode.fromValue(a.getInteger(R.styleable.CameraView_cameraMode, Mode.DEFAULT.value())); |
|
|
|
Hdr hdr = Hdr.fromValue(a.getInteger(R.styleable.CameraView_cameraHdr, Hdr.DEFAULT.value())); |
|
|
|
Hdr hdr = Hdr.fromValue(a.getInteger(R.styleable.CameraView_cameraHdr, Hdr.DEFAULT.value())); |
|
|
@ -207,6 +209,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
setMode(mode); |
|
|
|
setMode(mode); |
|
|
|
setWhiteBalance(whiteBalance); |
|
|
|
setWhiteBalance(whiteBalance); |
|
|
|
setGrid(grid); |
|
|
|
setGrid(grid); |
|
|
|
|
|
|
|
setGridColor(gridColor); |
|
|
|
setHdr(hdr); |
|
|
|
setHdr(hdr); |
|
|
|
setAudio(audio); |
|
|
|
setAudio(audio); |
|
|
|
setAudioBitRate(audioBitRate); |
|
|
|
setAudioBitRate(audioBitRate); |
|
|
@ -813,6 +816,17 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Controls the color of the grid lines that will be drawn |
|
|
|
|
|
|
|
* over the current layout. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param color a resolved color |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void setGridColor(@ColorInt int color) { |
|
|
|
|
|
|
|
mGridLinesLayout.setGridColor(color); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Controls the grids to be drawn over the current layout. |
|
|
|
* Controls the grids to be drawn over the current layout. |
|
|
|
* |
|
|
|
* |
|
|
@ -825,6 +839,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
mCameraController.setHdr(hdr); |
|
|
|
mCameraController.setHdr(hdr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Controls the preview engine. Should only be called |
|
|
|
* Controls the preview engine. Should only be called |
|
|
|
* if this CameraView was never added to any window |
|
|
|
* if this CameraView was never added to any window |
|
|
|