From 5665af635098f7b0781c0fe963222ffec99a2650 Mon Sep 17 00:00:00 2001 From: Vondear Date: Tue, 11 Sep 2018 14:21:59 +0800 Subject: [PATCH] update RxCameraView. --- .../main/api14/com/vondear/camera/Camera1.java | 16 ++++++++++------ RxKit/build.gradle | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/RxCamera/src/main/api14/com/vondear/camera/Camera1.java b/RxCamera/src/main/api14/com/vondear/camera/Camera1.java index 4a1fe360..11b00fbb 100644 --- a/RxCamera/src/main/api14/com/vondear/camera/Camera1.java +++ b/RxCamera/src/main/api14/com/vondear/camera/Camera1.java @@ -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 sizeSortedSet = mPictureSizes.sizes(mAspectRatio); + if (sizeSortedSet == null) { + sizeSortedSet = mPictureSizes.sizes(AspectRatio.parse("4:3")); + } + final Size pictureSize = sizeSortedSet.last(); if (mShowingPreview) { mCamera.stopPreview(); } @@ -371,9 +375,9 @@ private void releaseCamera() { /** * Calculate display orientation * https://developer.android.com/reference/android/hardware/Camera.html#setDisplayOrientation(int) - * + *

* This calculation is used for orienting the preview - * + *

* Note: This is not the same calculation as the camera rotation * * @param screenOrientationDegrees Screen orientation in degrees @@ -389,10 +393,10 @@ private int calcDisplayOrientation(int screenOrientationDegrees) { /** * Calculate camera rotation - * + *

* 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) - * + *

* Note: This is not the same calculation as the display orientation * * @param screenOrientationDegrees Screen orientation in degrees diff --git a/RxKit/build.gradle b/RxKit/build.gradle index 78ece19a..427f29b4 100644 --- a/RxKit/build.gradle +++ b/RxKit/build.gradle @@ -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' //沉浸式