@capgo/camera-preview 3.2.7 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CapgoCameraPreview.podspec +1 -1
  2. package/README.md +235 -48
  3. package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
  4. package/android/.gradle/7.4.2/checksums/md5-checksums.bin +0 -0
  5. package/android/.gradle/7.4.2/checksums/sha1-checksums.bin +0 -0
  6. package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  7. package/android/.gradle/7.4.2/dependencies-accessors/gc.properties +0 -0
  8. package/android/.gradle/7.4.2/executionHistory/executionHistory.lock +0 -0
  9. package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
  10. package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
  11. package/android/.gradle/7.4.2/gc.properties +0 -0
  12. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  13. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  14. package/android/.gradle/vcs-1/gc.properties +0 -0
  15. package/android/build.gradle +8 -8
  16. package/android/gradle/wrapper/gradle-wrapper.properties +2 -3
  17. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraActivity.java +5 -7
  18. package/dist/docs.json +373 -0
  19. package/dist/esm/definitions.d.ts +3 -3
  20. package/dist/esm/index.d.ts +1 -1
  21. package/dist/esm/index.js.map +1 -1
  22. package/dist/esm/web.d.ts +2 -2
  23. package/dist/esm/web.js +64 -65
  24. package/dist/esm/web.js.map +1 -1
  25. package/dist/plugin.cjs.js +148 -0
  26. package/dist/plugin.cjs.js.map +1 -0
  27. package/dist/plugin.js +151 -0
  28. package/dist/plugin.js.map +1 -0
  29. package/ios/Plugin/CameraController.swift +1 -1
  30. package/ios/Plugin/Plugin.swift +5 -5
  31. package/ios/Plugin.xcodeproj/project.pbxproj +8 -2
  32. package/ios/Podfile +1 -1
  33. package/ios/Podfile.lock +4 -4
  34. package/package.json +40 -35
@@ -8,7 +8,7 @@
8
8
  s.author = 'Ariel Hernandez Musa'
9
9
  s.source = { :git => 'https://github.com/Cap-go/camera-preview.git', :tag => s.version.to_s }
10
10
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
11
- s.ios.deployment_target = '12.0'
11
+ s.ios.deployment_target = '13.0'
12
12
  s.dependency 'Capacitor'
13
13
  s.swift_version = '5.1'
14
14
  end
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  <h3 align="center">Capacitor Camera Preview</h3>
3
3
  <p align="center"><strong><code>@capgo/camera-preview</code></strong></p>
4
4
  <br>
5
- <p align="center"><strong>CAPACITOR 3</strong></p><br>
5
+ <p align="center"><strong>CAPACITOR 4</strong></p><br>
6
6
 
7
7
  <p align="center">
8
8
  Capacitor plugin that allows camera interaction from Javascript and HTML<br>(based on cordova-plugin-camera-preview).
@@ -39,26 +39,31 @@ or
39
39
 
40
40
  npm install @capgo/camera-preview
41
41
  ```
42
+
42
43
  Then run
44
+
43
45
  ```
44
46
  npx cap sync
45
47
  ```
46
48
 
47
49
  ## Extra Android installation steps
48
- **Important** `camera-preview` 3+ requires Gradle 7. If you are using Gradle 4, please use [version 2](https://github.com/capacitor-community/camera-preview/tree/v2.1.0) of this plugin.
49
50
 
51
+ **Important** `camera-preview` 3+ requires Gradle 7.
50
52
  Open `android/app/src/main/AndroidManifest.xml` and above the closing `</manifest>` tag add this line to request the CAMERA permission:
53
+
51
54
  ```xml
52
55
  <uses-permission android:name="android.permission.CAMERA" />
53
56
  ```
57
+
54
58
  For more help consult the [Capacitor docs](https://capacitorjs.com/docs/android/configuration#configuring-androidmanifestxml).
55
59
 
56
60
  ## Extra iOS installation steps
61
+
57
62
  You will need to add two permissions to `Info.plist`. Follow the [Capacitor docs](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) and add permissions with the raw keys `NSCameraUsageDescription` and `NSMicrophoneUsageDescription`. `NSMicrophoneUsageDescription` is only required, if audio will be used. Otherwise set the `disableAudio` option to `true`, which also disables the microphone permission request.
58
63
 
59
64
  ## Extra Web installation steps
60
- Add `import '@capgo/camera-preview'` to you entry script in ionic on `app.module.ts`, so capacitor can register the web platform from the plugin
61
65
 
66
+ Add `import '@capgo/camera-preview'` to you entry script in ionic on `app.module.ts`, so capacitor can register the web platform from the plugin
62
67
 
63
68
  # Methods
64
69
 
@@ -67,23 +72,23 @@ Add `import '@capgo/camera-preview'` to you entry script in ionic on `app.module
67
72
  Starts the camera preview instance.
68
73
  <br>
69
74
 
70
- | Option | values | descriptions |
71
- |----------|---------------|------------------------------------------------------------------------|
72
- | position | front \| rear | Show front or rear camera when start the preview. Defaults to front |
73
- | width | number | (optional) The preview width in pixels, default window.screen.width (applicable to the android and ios platforms only) |
74
- | height | number | (optional) The preview height in pixels, default window.screen.height (applicable to the android and ios platforms only) |
75
- | x | number | (optional) The x origin, default 0 (applicable to the android and ios platforms only) |
76
- | y | number | (optional) The y origin, default 0 (applicable to the android and ios platforms only) |
77
- | toBack | boolean | (optional) Brings your html in front of your preview, default false (applicable to the android and ios platforms only) |
78
- | paddingBottom | number | (optional) The preview bottom padding in pixes. Useful to keep the appropriate preview sizes when orientation changes (applicable to the android and ios platforms only) |
79
- | rotateWhenOrientationChanged | boolean | (optional) Rotate preview when orientation changes (applicable to the ios platforms only; default value is true) |
80
- | storeToFile | boolean | (optional) Capture images to a file and return back the file path instead of returning base64 encoded data, default false. |
81
- | disableExifHeaderStripping | boolean | (optional) Disable automatic rotation of the image, and let the browser deal with it, default true (applicable to the android and ios platforms only) |
82
- | enableHighResolution | boolean | (optional) Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device |
83
- | disableAudio | boolean | (optional) Disables audio stream to prevent permission requests, default false. (applicable to web and iOS only) |
84
- | lockAndroidOrientation | boolean | (optional) Locks device orientation when camera is showing, default false. (applicable to Android only) |
85
- | enableOpacity | boolean | (optional) Make the camera preview see-through. Ideal for augmented reality uses. Default false (applicable to Android and web only)
86
- | enableZoom | boolean | (optional) Set if you can pinch to zoom. Default false (applicable to the android and ios platforms only)
75
+ | Option | values | descriptions |
76
+ | ---------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
77
+ | position | front \| rear | Show front or rear camera when start the preview. Defaults to front |
78
+ | width | number | (optional) The preview width in pixels, default window.screen.width (applicable to the android and ios platforms only) |
79
+ | height | number | (optional) The preview height in pixels, default window.screen.height (applicable to the android and ios platforms only) |
80
+ | x | number | (optional) The x origin, default 0 (applicable to the android and ios platforms only) |
81
+ | y | number | (optional) The y origin, default 0 (applicable to the android and ios platforms only) |
82
+ | toBack | boolean | (optional) Brings your html in front of your preview, default false (applicable to the android and ios platforms only) |
83
+ | paddingBottom | number | (optional) The preview bottom padding in pixes. Useful to keep the appropriate preview sizes when orientation changes (applicable to the android and ios platforms only) |
84
+ | rotateWhenOrientationChanged | boolean | (optional) Rotate preview when orientation changes (applicable to the ios platforms only; default value is true) |
85
+ | storeToFile | boolean | (optional) Capture images to a file and return back the file path instead of returning base64 encoded data, default false. |
86
+ | disableExifHeaderStripping | boolean | (optional) Disable automatic rotation of the image, and let the browser deal with it, default true (applicable to the android and ios platforms only) |
87
+ | enableHighResolution | boolean | (optional) Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device |
88
+ | disableAudio | boolean | (optional) Disables audio stream to prevent permission requests, default false. (applicable to web and iOS only) |
89
+ | lockAndroidOrientation | boolean | (optional) Locks device orientation when camera is showing, default false. (applicable to Android only) |
90
+ | enableOpacity | boolean | (optional) Make the camera preview see-through. Ideal for augmented reality uses. Default false (applicable to Android and web only) |
91
+ | enableZoom | boolean | (optional) Set if you can pinch to zoom. Default false (applicable to the android and ios platforms only) |
87
92
 
88
93
  <!-- <strong>Options:</strong>
89
94
  All options stated are optional and will default to values here
@@ -106,7 +111,7 @@ import { CameraPreview, CameraPreviewOptions } from '@capgo/camera-preview';
106
111
  const cameraPreviewOptions: CameraPreviewOptions = {
107
112
  position: 'rear',
108
113
  height: 1920,
109
- width: 1080
114
+ width: 1080,
110
115
  };
111
116
  CameraPreview.start(cameraPreviewOptions);
112
117
  ```
@@ -128,7 +133,8 @@ Take into account that this will make transparent all ion-content on application
128
133
  ```
129
134
 
130
135
  If the camera preview is not displaying after applying the above styles, apply transparent background color to the root div element of the parent component
131
- Ex: VueJS >> App.vue component
136
+ Ex: VueJS >> App.vue component
137
+
132
138
  ```html
133
139
  <template>
134
140
  <ion-app id="app">
@@ -143,7 +149,6 @@ Ex: VueJS >> App.vue component
143
149
  <style>
144
150
  ```
145
151
 
146
-
147
152
  ### stop()
148
153
 
149
154
  <info>Stops the camera preview instance.</info><br/>
@@ -153,9 +158,11 @@ CameraPreview.stop();
153
158
  ```
154
159
 
155
160
  ### flip()
161
+
156
162
  <info>Switch between rear and front camera only for android and ios, web is not supported</info>
163
+
157
164
  ```javascript
158
- CameraPreview.flip()
165
+ CameraPreview.flip();
159
166
  ```
160
167
 
161
168
  <!-- ### switchCamera([successCallback, errorCallback])
@@ -184,11 +191,11 @@ CameraPreview.hide();
184
191
 
185
192
  ### capture(options)
186
193
 
187
- | Option | values | descriptions |
188
- |----------|---------------|----------------------------------------------------------------------|
189
- | quality | number | (optional) The picture quality, 0 - 100, default 85 |
190
- | width | number | (optional) The picture width, default 0 (Device default) |
191
- | height | number | (optional) The picture height, default 0 (Device default) |
194
+ | Option | values | descriptions |
195
+ | ------- | ------ | --------------------------------------------------------- |
196
+ | quality | number | (optional) The picture quality, 0 - 100, default 85 |
197
+ | width | number | (optional) The picture width, default 0 (Device default) |
198
+ | height | number | (optional) The picture height, default 0 (Device default) |
192
199
 
193
200
  <!-- <info>Take the picture. If width and height are not specified or are 0 it will use the defaults. If width and height are specified, it will choose a supported photo size that is closest to width and height specified and has closest aspect ratio to the preview. The argument `quality` defaults to `85` and specifies the quality/compression value: `0=max compression`, `100=max quality`.</info><br/> -->
194
201
 
@@ -196,21 +203,20 @@ CameraPreview.hide();
196
203
  import { CameraPreviewPictureOptions } from '@capgo/camera-preview';
197
204
 
198
205
  const cameraPreviewPictureOptions: CameraPreviewPictureOptions = {
199
- quality: 50
206
+ quality: 50,
200
207
  };
201
208
 
202
209
  const result = await CameraPreview.capture(cameraPreviewPictureOptions);
203
210
  const base64PictureData = result.value;
204
211
 
205
212
  // do sometime with base64PictureData
206
-
207
213
  ```
208
214
 
209
215
  ### captureSample(options)
210
216
 
211
- | Option | values | descriptions |
212
- |----------|---------------|----------------------------------------------------------------------|
213
- | quality | number | (optional) The picture quality, 0 - 100, default 85 |
217
+ | Option | values | descriptions |
218
+ | ------- | ------ | --------------------------------------------------- |
219
+ | quality | number | (optional) The picture quality, 0 - 100, default 85 |
214
220
 
215
221
  <info>Captures a sample image from the video stream. Only for Android and iOS, web implementation falls back to `capture` method. This can be used to perform real-time analysis on the current frame in the video. The argument `quality` defaults to `85` and specifies the quality/compression value: `0=max compression`, `100=max quality`.</info><br/>
216
222
 
@@ -218,14 +224,13 @@ const base64PictureData = result.value;
218
224
  import { CameraSampleOptions } from '@capgo/camera-preview';
219
225
 
220
226
  const cameraSampleOptions: CameraSampleOptions = {
221
- quality: 50
227
+ quality: 50,
222
228
  };
223
229
 
224
230
  const result = await CameraPreview.captureSample(cameraSampleOptions);
225
231
  const base64PictureData = result.value;
226
232
 
227
233
  // do something with base64PictureData
228
-
229
234
  ```
230
235
 
231
236
  ### getSupportedFlashModes()
@@ -238,6 +243,7 @@ import { CameraPreviewFlashMode } from '@capgo/camera-preview';
238
243
  const flashModes = await CameraPreview.getSupportedFlashModes();
239
244
  const supportedFlashModes: CameraPreviewFlashMode[] = flashModes.result;
240
245
  ```
246
+
241
247
  ### setFlashMode(options)
242
248
 
243
249
  <info>Set the flash mode. See <code>[FLASH_MODE](#camera_Settings.FlashMode)</code> for details about the possible values for flashMode.</info><br/>
@@ -248,7 +254,7 @@ const CameraPreviewFlashMode: CameraPreviewFlashMode = 'torch';
248
254
  CameraPreview.setFlashMode(cameraPreviewFlashMode);
249
255
  ```
250
256
 
251
- ### startRecordVideo(options) ---- ANDROID only
257
+ ### startRecordVideo(options) ---- ANDROID only
252
258
 
253
259
  <info>Start capturing video</info><br/>
254
260
 
@@ -262,7 +268,7 @@ const cameraPreviewOptions: CameraPreviewOptions = {
262
268
  CameraPreview.startRecordVideo(cameraPreviewOptions);
263
269
  ```
264
270
 
265
- ### stopRecordVideo() ---- ANDROID only
271
+ ### stopRecordVideo() ---- ANDROID only
266
272
 
267
273
  <info>Finish capturing a video. The captured video will be returned as a file path and the video format is .mp4</info><br/>
268
274
 
@@ -271,13 +277,13 @@ const resultRecordVideo = await CameraPreview.stopRecordVideo();
271
277
  this.stopCamera();
272
278
  ```
273
279
 
274
- ### setOpacity(options: CameraOpacityOptions): Promise<{}>; ---- ANDROID only
280
+ ### setOpacity(options: CameraOpacityOptions): Promise<{}>; ---- ANDROID only
275
281
 
276
282
  <info>Set the opacity for the camera preview</info><br/>
277
283
 
278
284
  ```javascript
279
- const myCamera = CameraPreview.start({enableOpacity: true});
280
- myCamera.setOpacity({opacity: 0.4});
285
+ const myCamera = CameraPreview.start({ enableOpacity: true });
286
+ myCamera.setOpacity({ opacity: 0.4 });
281
287
  ```
282
288
 
283
289
  # Settings
@@ -288,13 +294,13 @@ myCamera.setOpacity({opacity: 0.4});
288
294
 
289
295
  <info>Flash mode settings:</info><br/>
290
296
 
291
- | Name | Type | Default | Note |
292
- | ------- | ------- | ------- | ------------- |
293
- | OFF | string | off | |
294
- | ON | string | on | |
295
- | AUTO | string | auto | |
296
- | RED_EYE | string | red-eye | Android Only |
297
- | TORCH | string | torch | |
297
+ | Name | Type | Default | Note |
298
+ | ------- | ------ | ------- | ------------ |
299
+ | OFF | string | off | |
300
+ | ON | string | on | |
301
+ | AUTO | string | auto | |
302
+ | RED_EYE | string | red-eye | Android Only |
303
+ | TORCH | string | torch | |
298
304
 
299
305
  <!--
300
306
 
@@ -429,3 +435,184 @@ Created by Marcel Barbosa Pinto [@mbppower](https://github.com/mbppower)
429
435
  A working example can be found at [Demo](https://github.com/capacitor-community/camera-preview/tree/master/demo)
430
436
 
431
437
  To run the demo on your local network and access media devices, a secure context is needed. Add an `.env` file at the root of the demo folder with `HTTPS=true` to start react with HTTPS.
438
+
439
+ ## API
440
+
441
+ <docgen-index>
442
+
443
+ * [`start(...)`](#start)
444
+ * [`stop()`](#stop)
445
+ * [`capture(...)`](#capture)
446
+ * [`captureSample(...)`](#capturesample)
447
+ * [`getSupportedFlashModes()`](#getsupportedflashmodes)
448
+ * [`setFlashMode(...)`](#setflashmode)
449
+ * [`flip()`](#flip)
450
+ * [`setOpacity(...)`](#setopacity)
451
+ * [Interfaces](#interfaces)
452
+ * [Type Aliases](#type-aliases)
453
+
454
+ </docgen-index>
455
+
456
+ <docgen-api>
457
+ <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
458
+
459
+ ### start(...)
460
+
461
+ ```typescript
462
+ start(options: CameraPreviewOptions) => Promise<void>
463
+ ```
464
+
465
+ | Param | Type |
466
+ | ------------- | --------------------------------------------------------------------- |
467
+ | **`options`** | <code><a href="#camerapreviewoptions">CameraPreviewOptions</a></code> |
468
+
469
+ --------------------
470
+
471
+
472
+ ### stop()
473
+
474
+ ```typescript
475
+ stop() => Promise<void>
476
+ ```
477
+
478
+ --------------------
479
+
480
+
481
+ ### capture(...)
482
+
483
+ ```typescript
484
+ capture(options: CameraPreviewPictureOptions) => Promise<{ value: string; }>
485
+ ```
486
+
487
+ | Param | Type |
488
+ | ------------- | ----------------------------------------------------------------------------------- |
489
+ | **`options`** | <code><a href="#camerapreviewpictureoptions">CameraPreviewPictureOptions</a></code> |
490
+
491
+ **Returns:** <code>Promise&lt;{ value: string; }&gt;</code>
492
+
493
+ --------------------
494
+
495
+
496
+ ### captureSample(...)
497
+
498
+ ```typescript
499
+ captureSample(options: CameraSampleOptions) => Promise<{ value: string; }>
500
+ ```
501
+
502
+ | Param | Type |
503
+ | ------------- | ------------------------------------------------------------------- |
504
+ | **`options`** | <code><a href="#camerasampleoptions">CameraSampleOptions</a></code> |
505
+
506
+ **Returns:** <code>Promise&lt;{ value: string; }&gt;</code>
507
+
508
+ --------------------
509
+
510
+
511
+ ### getSupportedFlashModes()
512
+
513
+ ```typescript
514
+ getSupportedFlashModes() => Promise<{ result: CameraPreviewFlashMode[]; }>
515
+ ```
516
+
517
+ **Returns:** <code>Promise&lt;{ result: CameraPreviewFlashMode[]; }&gt;</code>
518
+
519
+ --------------------
520
+
521
+
522
+ ### setFlashMode(...)
523
+
524
+ ```typescript
525
+ setFlashMode(options: { flashMode: CameraPreviewFlashMode | string; }) => Promise<void>
526
+ ```
527
+
528
+ | Param | Type |
529
+ | ------------- | ----------------------------------- |
530
+ | **`options`** | <code>{ flashMode: string; }</code> |
531
+
532
+ --------------------
533
+
534
+
535
+ ### flip()
536
+
537
+ ```typescript
538
+ flip() => Promise<void>
539
+ ```
540
+
541
+ --------------------
542
+
543
+
544
+ ### setOpacity(...)
545
+
546
+ ```typescript
547
+ setOpacity(options: CameraOpacityOptions) => Promise<void>
548
+ ```
549
+
550
+ | Param | Type |
551
+ | ------------- | --------------------------------------------------------------------- |
552
+ | **`options`** | <code><a href="#cameraopacityoptions">CameraOpacityOptions</a></code> |
553
+
554
+ --------------------
555
+
556
+
557
+ ### Interfaces
558
+
559
+
560
+ #### CameraPreviewOptions
561
+
562
+ | Prop | Type | Description |
563
+ | ---------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
564
+ | **`parent`** | <code>string</code> | Parent element to attach the video preview element to (applicable to the web platform only) |
565
+ | **`className`** | <code>string</code> | Class name to add to the video preview element (applicable to the web platform only) |
566
+ | **`width`** | <code>number</code> | The preview width in pixels, default window.screen.width |
567
+ | **`height`** | <code>number</code> | The preview height in pixels, default window.screen.height |
568
+ | **`x`** | <code>number</code> | The x origin, default 0 (applicable to the android and ios platforms only) |
569
+ | **`y`** | <code>number</code> | The y origin, default 0 (applicable to the android and ios platforms only) |
570
+ | **`toBack`** | <code>boolean</code> | Brings your html in front of your preview, default false (applicable to the android only) |
571
+ | **`paddingBottom`** | <code>number</code> | The preview bottom padding in pixes. Useful to keep the appropriate preview sizes when orientation changes (applicable to the android and ios platforms only) |
572
+ | **`rotateWhenOrientationChanged`** | <code>boolean</code> | Rotate preview when orientation changes (applicable to the ios platforms only; default value is true) |
573
+ | **`position`** | <code>string</code> | Choose the camera to use 'front' or 'rear', default 'front' |
574
+ | **`storeToFile`** | <code>boolean</code> | Defaults to false - Capture images to a file and return the file path instead of returning base64 encoded data |
575
+ | **`disableExifHeaderStripping`** | <code>boolean</code> | Defaults to false - Android Only - Disable automatic rotation of the image, and let the browser deal with it (keep reading on how to achieve it) |
576
+ | **`enableHighResolution`** | <code>boolean</code> | Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device * |
577
+ | **`disableAudio`** | <code>boolean</code> | Defaults to false - Web only - Disables audio stream to prevent permission requests and output switching |
578
+ | **`lockAndroidOrientation`** | <code>boolean</code> | Android Only - Locks device orientation when camera is showing. |
579
+ | **`enableOpacity`** | <code>boolean</code> | Defaults to false - Android and Web only. Set if camera preview can change opacity. |
580
+ | **`enableZoom`** | <code>boolean</code> | Defaults to false - Android only. Set if camera preview will support pinch to zoom. |
581
+
582
+
583
+ #### CameraPreviewPictureOptions
584
+
585
+ | Prop | Type | Description |
586
+ | ------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
587
+ | **`height`** | <code>number</code> | The picture height, optional, default 0 (Device default) |
588
+ | **`width`** | <code>number</code> | The picture width, optional, default 0 (Device default) |
589
+ | **`quality`** | <code>number</code> | The picture quality, 0 - 100, default 85 on `iOS/Android`. If left undefined, the `web` implementation will export a PNG, otherwise a JPEG will be generated |
590
+
591
+
592
+ #### CameraSampleOptions
593
+
594
+ | Prop | Type | Description |
595
+ | ------------- | ------------------- | ---------------------------------------- |
596
+ | **`quality`** | <code>number</code> | The picture quality, 0 - 100, default 85 |
597
+
598
+
599
+ #### CameraOpacityOptions
600
+
601
+ | Prop | Type | Description |
602
+ | ------------- | ------------------- | ----------------------------------------------------- |
603
+ | **`opacity`** | <code>number</code> | The percent opacity to set for camera view, default 1 |
604
+
605
+
606
+ ### Type Aliases
607
+
608
+
609
+ #### CameraPosition
610
+
611
+ <code>'rear' | 'front'</code>
612
+
613
+
614
+ #### CameraPreviewFlashMode
615
+
616
+ <code>'off' | 'on' | 'auto' | 'red-eye' | 'torch'</code>
617
+
618
+ </docgen-api>
File without changes
@@ -0,0 +1,2 @@
1
+ #Fri Nov 11 07:42:23 UTC 2022
2
+ gradle.version=7.4.2
File without changes
@@ -1,8 +1,8 @@
1
1
  ext {
2
- junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.1'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.2'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.3.0'
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
4
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
5
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
6
6
  }
7
7
 
8
8
  buildscript {
@@ -11,17 +11,17 @@ buildscript {
11
11
  google()
12
12
  }
13
13
  dependencies {
14
- classpath 'com.android.tools.build:gradle:3.3.2'
14
+ classpath 'com.android.tools.build:gradle:7.2.1'
15
15
  }
16
16
  }
17
17
 
18
18
  apply plugin: 'com.android.library'
19
19
 
20
20
  android {
21
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
21
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
22
22
  defaultConfig {
23
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
24
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
23
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
24
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
25
25
  versionCode 1
26
26
  versionName "1.0"
27
27
  testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -1,6 +1,5 @@
1
- #Fri Dec 01 12:41:00 CST 2017
2
1
  distributionBase=GRADLE_USER_HOME
3
2
  distributionPath=wrapper/dists
3
+ distributionUrl=https://services.gradle.org/distributions/gradle-7.4.2-bin.zip
4
4
  zipStoreBase=GRADLE_USER_HOME
5
- zipStorePath=wrapper/dists
6
- distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
5
+ zipStorePath=wrapper/dists
@@ -396,15 +396,16 @@ public class CameraActivity extends Fragment {
396
396
  super.onConfigurationChanged(newConfig);
397
397
 
398
398
  final FrameLayout frameContainerLayout = (FrameLayout) view.findViewById(
399
- getResources().getIdentifier("frame_container", "id", appResourcesPackage)
399
+ getResources().getIdentifier("frame_container", "id", appResourcesPackage)
400
400
  );
401
401
 
402
- final int previousOrientation = frameContainerLayout.getHeight() > frameContainerLayout.getWidth() ? Configuration.ORIENTATION_PORTRAIT : Configuration.ORIENTATION_LANDSCAPE;
402
+ final int previousOrientation = frameContainerLayout.getHeight() > frameContainerLayout.getWidth()
403
+ ? Configuration.ORIENTATION_PORTRAIT
404
+ : Configuration.ORIENTATION_LANDSCAPE;
403
405
  // Checks if the orientation of the screen has changed
404
406
  if (newConfig.orientation != previousOrientation) {
405
-
406
407
  final RelativeLayout frameCamContainerLayout = (RelativeLayout) view.findViewById(
407
- getResources().getIdentifier("frame_camera_cont", "id", appResourcesPackage)
408
+ getResources().getIdentifier("frame_camera_cont", "id", appResourcesPackage)
408
409
  );
409
410
 
410
411
  frameContainerLayout.getLayoutParams().width = frameCamContainerLayout.getHeight();
@@ -419,12 +420,9 @@ public class CameraActivity extends Fragment {
419
420
  frameCamContainerLayout.forceLayout();
420
421
 
421
422
  mPreview.setCameraDisplayOrientation();
422
-
423
423
  }
424
-
425
424
  }
426
425
 
427
-
428
426
  public Camera getCamera() {
429
427
  return mCamera;
430
428
  }