Skip to content

Commit

Permalink
update RxCameraView.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vondear authored and Vondear committed Sep 11, 2018
1 parent 21eac2f commit 5665af6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions RxCamera/src/main/api14/com/vondear/camera/Camera1.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,12 @@ void adjustCameraParameters() {
Size size = chooseOptimalSize(sizes);

// Always re-apply camera parameters
// Largest picture size in this ratio
final Size pictureSize = mPictureSizes.sizes(mAspectRatio).last();
// Largest picture size in this ratio AspectRatio.parse(aspectRatio)
SortedSet<Size> sizeSortedSet = mPictureSizes.sizes(mAspectRatio);
if (sizeSortedSet == null) {
sizeSortedSet = mPictureSizes.sizes(AspectRatio.parse("4:3"));
}
final Size pictureSize = sizeSortedSet.last();
if (mShowingPreview) {
mCamera.stopPreview();
}
Expand Down Expand Up @@ -371,9 +375,9 @@ private void releaseCamera() {
/**
* Calculate display orientation
* https://developer.android.com/reference/android/hardware/Camera.html#setDisplayOrientation(int)
*
* <p>
* This calculation is used for orienting the preview
*
* <p>
* Note: This is not the same calculation as the camera rotation
*
* @param screenOrientationDegrees Screen orientation in degrees
Expand All @@ -389,10 +393,10 @@ private int calcDisplayOrientation(int screenOrientationDegrees) {

/**
* Calculate camera rotation
*
* <p>
* This calculation is applied to the output JPEG either via Exif Orientation tag
* or by actually transforming the bitmap. (Determined by vendor camera API implementation)
*
* <p>
* Note: This is not the same calculation as the display orientation
*
* @param screenOrientationDegrees Screen orientation in degrees
Expand Down
2 changes: 1 addition & 1 deletion RxKit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies {
//recyclerview包
compileOnly 'com.android.support:recyclerview-v7:27.1.1'
compileOnly 'com.android.support:support-annotations:27.1.1'
compileOnly 'com.android.support.constraint:constraint-layout:1.1.2'
compileOnly 'com.android.support.constraint:constraint-layout:1.1.3'
//流式布局
compileOnly 'com.google.android:flexbox:0.3.2'
//沉浸式
Expand Down

0 comments on commit 5665af6

Please sign in to comment.