Upgrade Example to RN 0.64 (#83)

* ReactLogger: Also log function

* Run SwiftFormat & SwiftLint in example project

* Upgrade to RN 0.64 1/2

* Update lockfiles

* Upgrade a few packages

* index.tsx -> index.js

* Upgrade docusaurus

* Fix line length violation

* Update CameraView.swift

* Update gradle plugin

* Fix example to prefer higher res cameras

* Remove unused log line

* Update App.tsx
This commit is contained in:
Marc Rousavy
2021-03-19 15:53:19 +01:00
committed by GitHub
parent 1def7230c8
commit 35806ff660
30 changed files with 2160 additions and 2831 deletions

View File

@@ -24,8 +24,8 @@ export const sortDevices = (left: CameraDevice, right: CameraDevice): number =>
if (leftHasWideAngle) leftPoints += 5;
if (rightHasWideAngle) rightPoints += 5;
if (left.devices.length > right.devices.length) leftPoints += 2;
if (right.devices.length > left.devices.length) rightPoints += 2;
if (left.devices.length > right.devices.length) leftPoints += 3;
if (right.devices.length > left.devices.length) rightPoints += 3;
return rightPoints - leftPoints;
};
@@ -96,7 +96,12 @@ export const filterFormatsByAspectRatio = (formats: CameraDeviceFormat[], viewSi
else return prev;
}, Number.MAX_SAFE_INTEGER);
return formats.filter((f) => getFormatAspectRatioOverflow(f, viewSize) === minOverflow);
return formats.filter((f) => {
// percentage of difference in overflow from this format, to the minimum available overflow
const overflowDiff = (getFormatAspectRatioOverflow(f, viewSize) - minOverflow) / minOverflow;
// we have an acceptance of 25%, if overflow is more than 25% off to the min available overflow, we drop it
return overflowDiff < 0.25;
});
};
/**