scoplan.camera 1.2.9 → 1.2.11
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.
package/package.json
CHANGED
|
@@ -307,8 +307,11 @@ public class CameraFragment extends Fragment implements scoplan.camera.OnImageCa
|
|
|
307
307
|
surfaceView.setLayoutParams(layoutParams);
|
|
308
308
|
// Set buffer to camera native resolution
|
|
309
309
|
mSurfaceHolder.setFixedSize(optimalPreviewSize.getWidth(), optimalPreviewSize.getHeight());
|
|
310
|
-
// surfaceChanged will be called → createCameraPreview
|
|
311
310
|
surfaceSizeConfigured = true;
|
|
311
|
+
// Always call createCameraPreview directly.
|
|
312
|
+
// surfaceChanged may or may not fire depending on the device;
|
|
313
|
+
// createCameraPreview is safe to call multiple times (guarded by previewReady).
|
|
314
|
+
createCameraPreview();
|
|
312
315
|
});
|
|
313
316
|
return;
|
|
314
317
|
}
|
|
@@ -368,6 +371,10 @@ public class CameraFragment extends Fragment implements scoplan.camera.OnImageCa
|
|
|
368
371
|
if (cameraId != null ) {
|
|
369
372
|
return;
|
|
370
373
|
}
|
|
374
|
+
// Ensure background thread is started
|
|
375
|
+
if (mBackgroundHandler == null) {
|
|
376
|
+
startBackgroundThread();
|
|
377
|
+
}
|
|
371
378
|
for (String id : manager.getCameraIdList()) {
|
|
372
379
|
CameraCharacteristics cameraCharacteristics =
|
|
373
380
|
manager.getCameraCharacteristics(id);
|
|
@@ -393,7 +400,7 @@ public class CameraFragment extends Fragment implements scoplan.camera.OnImageCa
|
|
|
393
400
|
}, CAMERA_REQUEST_PERMISSION);
|
|
394
401
|
return;
|
|
395
402
|
}
|
|
396
|
-
manager.openCamera(cameraId, stateCallback,
|
|
403
|
+
manager.openCamera(cameraId, stateCallback, mBackgroundHandler);
|
|
397
404
|
} catch (Exception e) {
|
|
398
405
|
Sentry.captureException(e);
|
|
399
406
|
this.failedCapture();
|
|
@@ -547,6 +554,7 @@ public class CameraFragment extends Fragment implements scoplan.camera.OnImageCa
|
|
|
547
554
|
}
|
|
548
555
|
cameraIsOpen = false;
|
|
549
556
|
previewReady = false;
|
|
557
|
+
surfaceSizeConfigured = false;
|
|
550
558
|
cameraDevice = null;
|
|
551
559
|
cameraId = null;
|
|
552
560
|
}
|
package/src/ios/ScoplanCamera.m
CHANGED
|
@@ -79,6 +79,11 @@
|
|
|
79
79
|
[imagePreview setImage:nil];
|
|
80
80
|
UIView* view = [self.cameraUI.cameraOverlayView viewWithTag:11];
|
|
81
81
|
[view setHidden:YES];
|
|
82
|
+
// No more photos: button back to "X"
|
|
83
|
+
UIButton* cancelBtn = (UIButton *)[self.cameraUI.cameraOverlayView viewWithTag:2];
|
|
84
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
85
|
+
[cancelBtn setTitle:@"X" forState:UIControlStateNormal];
|
|
86
|
+
});
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
89
|
|
|
@@ -87,9 +92,23 @@
|
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
- (void)insertPicture:(NSString*)url{
|
|
90
|
-
UIView*
|
|
91
|
-
[view setHidden:NO];
|
|
95
|
+
UIView* topBar = [self.cameraUI.cameraOverlayView viewWithTag:11];
|
|
92
96
|
[mpictures addObject:url];
|
|
97
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
98
|
+
UIButton* cancelBtn = (UIButton *)[self.cameraUI.cameraOverlayView viewWithTag:2];
|
|
99
|
+
[cancelBtn setTitle:@"OK" forState:UIControlStateNormal];
|
|
100
|
+
|
|
101
|
+
// Position top bar below safe area
|
|
102
|
+
CGFloat safeTop = 0;
|
|
103
|
+
if (@available(iOS 11.0, *)) {
|
|
104
|
+
safeTop = self.cameraUI.view.safeAreaInsets.top;
|
|
105
|
+
}
|
|
106
|
+
if (safeTop < 20) safeTop = 20;
|
|
107
|
+
CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
|
|
108
|
+
CGFloat barHeight = 44.0;
|
|
109
|
+
topBar.frame = CGRectMake(0, safeTop, screenWidth, barHeight);
|
|
110
|
+
[topBar setHidden:NO];
|
|
111
|
+
});
|
|
93
112
|
}
|
|
94
113
|
|
|
95
114
|
- (void)flushPicture:(NSString*)url{
|
|
@@ -134,7 +153,7 @@
|
|
|
134
153
|
UIButton *cancelBtn = (UIButton *)[self.overLayView viewWithTag:2];
|
|
135
154
|
UIButton *cancelBtn2 = (UIButton *)[self.overLayView viewWithTag:12];
|
|
136
155
|
dispatch_async( dispatch_get_main_queue(), ^{
|
|
137
|
-
[cancelBtn setTitle:@"
|
|
156
|
+
[cancelBtn setTitle:@"X" forState:UIControlStateNormal];
|
|
138
157
|
});
|
|
139
158
|
[cancelBtn addTarget: self action: @selector(cancelClicked:) forControlEvents: UIControlEventTouchUpInside];
|
|
140
159
|
[cancelBtn2 addTarget: self action: @selector(cancelConfirm:) forControlEvents: UIControlEventTouchUpInside];
|
|
@@ -167,11 +186,44 @@
|
|
|
167
186
|
self.cameraUI.allowsEditing = NO;
|
|
168
187
|
self.cameraUI.delegate = delegate;
|
|
169
188
|
self.overLayView.frame = self.cameraUI.cameraOverlayView.frame;
|
|
189
|
+
self.overLayView.backgroundColor = [UIColor clearColor];
|
|
170
190
|
self.cameraUI.cameraOverlayView = self.overLayView;
|
|
171
|
-
float camHeight = ([[UIScreen mainScreen] bounds].size.height/2)*15/100;
|
|
172
191
|
UIImageView * imagePreview = ((UIImageView *)[self.overLayView viewWithTag:3]);
|
|
173
192
|
[self.cameraUI initData:imagePreview mCamera:self];
|
|
174
|
-
|
|
193
|
+
|
|
194
|
+
// Scale camera preview to fill from safe-area-top to bottom of screen
|
|
195
|
+
CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height;
|
|
196
|
+
CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
|
|
197
|
+
CGFloat safeTop = 0;
|
|
198
|
+
if (@available(iOS 11.0, *)) {
|
|
199
|
+
UIWindow *window = UIApplication.sharedApplication.keyWindow;
|
|
200
|
+
if (window) safeTop = window.safeAreaInsets.top;
|
|
201
|
+
}
|
|
202
|
+
if (safeTop < 20) safeTop = 20;
|
|
203
|
+
CGFloat visibleHeight = screenHeight - safeTop;
|
|
204
|
+
CGFloat cameraPreviewHeight = screenWidth * 4.0 / 3.0;
|
|
205
|
+
CGFloat scale = visibleHeight / cameraPreviewHeight;
|
|
206
|
+
if (scale < 1.0) scale = 1.0;
|
|
207
|
+
// Translate the scaled preview down so its top aligns with safe-area-top
|
|
208
|
+
CGFloat translateY = safeTop / 2.0 + (visibleHeight - cameraPreviewHeight) / 2.0;
|
|
209
|
+
CGAffineTransform scaleTransform = CGAffineTransformMakeScale(scale, scale);
|
|
210
|
+
CGAffineTransform translateTransform = CGAffineTransformMakeTranslation(0, translateY);
|
|
211
|
+
self.cameraUI.cameraViewTransform = CGAffineTransformConcat(scaleTransform, translateTransform);
|
|
212
|
+
|
|
213
|
+
// Add a black bar covering the safe-area-top (behind status bar)
|
|
214
|
+
UIView *statusBarBg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, safeTop)];
|
|
215
|
+
statusBarBg.backgroundColor = [UIColor blackColor];
|
|
216
|
+
statusBarBg.tag = 98;
|
|
217
|
+
[self.overLayView addSubview:statusBarBg];
|
|
218
|
+
[self.overLayView sendSubviewToBack:statusBarBg];
|
|
219
|
+
|
|
220
|
+
// Switch top bar (tag=11) to frame-based positioning so we can place it below safe area
|
|
221
|
+
UIView *topBar = [self.overLayView viewWithTag:11];
|
|
222
|
+
if (topBar) {
|
|
223
|
+
topBar.translatesAutoresizingMaskIntoConstraints = YES;
|
|
224
|
+
topBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
|
|
225
|
+
}
|
|
226
|
+
|
|
175
227
|
[controller presentViewController:self.cameraUI animated:YES completion:nil];
|
|
176
228
|
return YES;
|
|
177
229
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="
|
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
|
3
3
|
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
|
4
4
|
<dependencies>
|
|
5
|
-
<
|
|
6
|
-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
|
|
5
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24504"/>
|
|
7
6
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
|
8
7
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
|
9
8
|
</dependencies>
|
|
@@ -17,41 +16,51 @@
|
|
|
17
16
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
18
17
|
<subviews>
|
|
19
18
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Dph-cD-OZJ" userLabel="Preview" customClass="AVCamPreviewView">
|
|
20
|
-
<rect key="frame" x="0.0" y="0.0" width="414" height="
|
|
21
|
-
<color key="backgroundColor" white="
|
|
19
|
+
<rect key="frame" x="0.0" y="0.0" width="414" height="828"/>
|
|
20
|
+
<color key="backgroundColor" white="0" alpha="1" colorSpace="calibratedWhite"/>
|
|
22
21
|
<gestureRecognizers/>
|
|
23
22
|
<connections>
|
|
24
23
|
<outletCollection property="gestureRecognizers" destination="Wqi-ea-KMR" appends="YES" id="oAd-i0-IMA"/>
|
|
25
24
|
</connections>
|
|
26
25
|
</view>
|
|
27
|
-
<view alpha="0.25" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jGC-3L-9Um" userLabel="black">
|
|
28
|
-
<rect key="frame" x="0.0" y="735" width="414" height="127"/>
|
|
29
|
-
<color key="backgroundColor" systemColor="viewFlipsideBackgroundColor"/>
|
|
30
|
-
<constraints>
|
|
31
|
-
<constraint firstAttribute="width" secondItem="jGC-3L-9Um" secondAttribute="height" multiplier="160:49" id="YuY-vB-8QI"/>
|
|
32
|
-
</constraints>
|
|
33
|
-
</view>
|
|
34
26
|
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="lmm-Ty-vl6" userLabel="imageview">
|
|
35
|
-
<rect key="frame" x="20" y="
|
|
27
|
+
<rect key="frame" x="20" y="753" width="50" height="50"/>
|
|
36
28
|
<constraints>
|
|
37
29
|
<constraint firstAttribute="width" constant="50" id="GxG-7V-98h"/>
|
|
38
30
|
<constraint firstAttribute="height" constant="50" id="j8A-7b-Pdm"/>
|
|
39
31
|
</constraints>
|
|
40
32
|
</imageView>
|
|
41
|
-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center"
|
|
42
|
-
<rect key="frame" x="
|
|
33
|
+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nqA-FF-aMJ">
|
|
34
|
+
<rect key="frame" x="350" y="756" width="44" height="44"/>
|
|
43
35
|
<constraints>
|
|
44
|
-
<constraint firstAttribute="height" constant="
|
|
36
|
+
<constraint firstAttribute="height" constant="44" id="1gH-LF-9jk"/>
|
|
37
|
+
<constraint firstAttribute="width" constant="44" id="nqA-w-44w"/>
|
|
45
38
|
</constraints>
|
|
46
|
-
<
|
|
47
|
-
|
|
39
|
+
<color key="backgroundColor" red="0.6" green="0.6" blue="0.6" alpha="0.8" colorSpace="calibratedRGB"/>
|
|
40
|
+
<state key="normal" title="X">
|
|
41
|
+
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
|
48
42
|
</state>
|
|
43
|
+
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
|
|
44
|
+
<userDefinedRuntimeAttributes>
|
|
45
|
+
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
|
46
|
+
<real key="value" value="22"/>
|
|
47
|
+
</userDefinedRuntimeAttribute>
|
|
48
|
+
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds">
|
|
49
|
+
<boolean key="value" value="YES"/>
|
|
50
|
+
</userDefinedRuntimeAttribute>
|
|
51
|
+
<userDefinedRuntimeAttribute type="number" keyPath="layer.borderWidth">
|
|
52
|
+
<real key="value" value="2"/>
|
|
53
|
+
</userDefinedRuntimeAttribute>
|
|
54
|
+
<userDefinedRuntimeAttribute type="color" keyPath="layer.borderColor">
|
|
55
|
+
<color key="value" white="0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
|
56
|
+
</userDefinedRuntimeAttribute>
|
|
57
|
+
</userDefinedRuntimeAttributes>
|
|
49
58
|
<connections>
|
|
50
59
|
<action selector="backtowebview:" destination="AA8-Jf-iAm" eventType="touchUpInside" id="8HQ-lG-VyA"/>
|
|
51
60
|
</connections>
|
|
52
61
|
</button>
|
|
53
62
|
<button opaque="NO" contentMode="center" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cRf-Sp-1y2">
|
|
54
|
-
<rect key="frame" x="182" y="
|
|
63
|
+
<rect key="frame" x="182" y="753" width="50" height="50"/>
|
|
55
64
|
<constraints>
|
|
56
65
|
<constraint firstAttribute="height" constant="50" id="3uF-tj-9po"/>
|
|
57
66
|
<constraint firstAttribute="width" secondItem="cRf-Sp-1y2" secondAttribute="height" multiplier="1:1" id="jhA-cY-Fs5"/>
|
|
@@ -63,7 +72,7 @@
|
|
|
63
72
|
</connections>
|
|
64
73
|
</button>
|
|
65
74
|
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="YrK-DJ-ony">
|
|
66
|
-
<rect key="frame" x="182" y="
|
|
75
|
+
<rect key="frame" x="182" y="753" width="50" height="50"/>
|
|
67
76
|
<constraints>
|
|
68
77
|
<constraint firstAttribute="height" constant="50" id="1ap-FV-bAg"/>
|
|
69
78
|
<constraint firstAttribute="width" constant="50" id="8dJ-8K-RdS"/>
|
|
@@ -71,27 +80,23 @@
|
|
|
71
80
|
</imageView>
|
|
72
81
|
</subviews>
|
|
73
82
|
<viewLayoutGuide key="safeArea" id="jij-t7-zCY"/>
|
|
74
|
-
<color key="backgroundColor" white="
|
|
83
|
+
<color key="backgroundColor" white="0" alpha="1" colorSpace="calibratedWhite"/>
|
|
75
84
|
<constraints>
|
|
76
85
|
<constraint firstItem="jij-t7-zCY" firstAttribute="bottom" secondItem="YrK-DJ-ony" secondAttribute="bottom" constant="25" id="0MC-Rx-Lgu"/>
|
|
77
|
-
<constraint firstItem="jGC-3L-9Um" firstAttribute="leading" secondItem="jij-t7-zCY" secondAttribute="leading" id="3iI-5o-Y21"/>
|
|
78
86
|
<constraint firstItem="YrK-DJ-ony" firstAttribute="centerX" secondItem="8ze-qw-dRA" secondAttribute="centerX" id="56H-C7-K1g"/>
|
|
79
|
-
<constraint firstItem="Dph-cD-OZJ" firstAttribute="bottom" secondItem="
|
|
87
|
+
<constraint firstItem="Dph-cD-OZJ" firstAttribute="bottom" secondItem="8ze-qw-dRA" secondAttribute="bottom" id="Bla-Mv-ywP"/>
|
|
80
88
|
<constraint firstItem="cRf-Sp-1y2" firstAttribute="centerX" secondItem="8ze-qw-dRA" secondAttribute="centerX" id="IwK-Lt-F2A"/>
|
|
81
89
|
<constraint firstItem="Dph-cD-OZJ" firstAttribute="leading" secondItem="8ze-qw-dRA" secondAttribute="leading" id="ZPE-Xb-bhT"/>
|
|
82
90
|
<constraint firstItem="jij-t7-zCY" firstAttribute="bottom" secondItem="cRf-Sp-1y2" secondAttribute="bottom" constant="25" id="d7J-t5-TqX"/>
|
|
83
91
|
<constraint firstAttribute="trailing" secondItem="Dph-cD-OZJ" secondAttribute="trailing" id="owy-xt-NSQ"/>
|
|
84
92
|
<constraint firstItem="Dph-cD-OZJ" firstAttribute="top" secondItem="8ze-qw-dRA" secondAttribute="top" id="pfp-tG-hKN"/>
|
|
85
|
-
<constraint firstItem="jGC-3L-9Um" firstAttribute="trailing" secondItem="jij-t7-zCY" secondAttribute="trailing" id="qXe-P5-MY6"/>
|
|
86
93
|
<constraint firstItem="jij-t7-zCY" firstAttribute="bottom" secondItem="nqA-FF-aMJ" secondAttribute="bottom" constant="35" id="rjG-z6-8aH"/>
|
|
87
|
-
<constraint firstItem="
|
|
88
|
-
<constraint firstItem="nqA-FF-aMJ" firstAttribute="centerX" secondItem="8ze-qw-dRA" secondAttribute="centerX" constant="95" id="sCH-2R-4Wi"/>
|
|
94
|
+
<constraint firstItem="jij-t7-zCY" firstAttribute="trailing" secondItem="nqA-FF-aMJ" secondAttribute="trailing" constant="20" id="sCH-2R-4Wi"/>
|
|
89
95
|
<constraint firstItem="jij-t7-zCY" firstAttribute="bottom" secondItem="lmm-Ty-vl6" secondAttribute="bottom" constant="25" id="t0l-GX-7v2"/>
|
|
90
96
|
<constraint firstItem="lmm-Ty-vl6" firstAttribute="leading" secondItem="jij-t7-zCY" secondAttribute="leading" constant="20" id="zuS-KY-tMG"/>
|
|
91
97
|
</constraints>
|
|
92
98
|
</view>
|
|
93
99
|
<connections>
|
|
94
|
-
<outlet property="blackbottom" destination="jGC-3L-9Um" id="meg-H7-5oV"/>
|
|
95
100
|
<outlet property="imageview" destination="lmm-Ty-vl6" id="4tT-eQ-Drt"/>
|
|
96
101
|
<outlet property="okbutton" destination="nqA-FF-aMJ" id="BGp-mM-zEZ"/>
|
|
97
102
|
<outlet property="photoButton" destination="cRf-Sp-1y2" id="E8a-Tn-i4I"/>
|
|
@@ -108,8 +113,5 @@
|
|
|
108
113
|
</scenes>
|
|
109
114
|
<resources>
|
|
110
115
|
<image name="cameraicon" width="214" height="213"/>
|
|
111
|
-
<systemColor name="viewFlipsideBackgroundColor">
|
|
112
|
-
<color red="0.1215686274509804" green="0.12941176470588239" blue="0.14117647058823529" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
113
|
-
</systemColor>
|
|
114
116
|
</resources>
|
|
115
117
|
</document>
|
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
#import "UICustomPickerController.h"
|
|
8
8
|
|
|
9
9
|
@implementation UICustomPickerController
|
|
10
|
+
|
|
11
|
+
- (BOOL)prefersStatusBarHidden {
|
|
12
|
+
return NO;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
- (UIStatusBarStyle)preferredStatusBarStyle {
|
|
16
|
+
return UIStatusBarStyleLightContent;
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
-(void)initData:(UIImageView*)souche mCamera:(ScoplanCamera*)mcm{
|
|
11
20
|
imageSouche = souche;
|
|
12
21
|
mCamera = mcm;
|
|
@@ -64,8 +64,8 @@ typedef NS_ENUM( NSInteger, AVCamDepthDataDeliveryMode ) {
|
|
|
64
64
|
@property (strong, nonatomic) IBOutlet UIView *rootView;
|
|
65
65
|
@property (strong, nonatomic) IBOutlet UIImageView *imageview;
|
|
66
66
|
@property (strong, nonatomic) IBOutlet UIButton *okbutton;
|
|
67
|
-
@property (strong, nonatomic) IBOutlet UIView *blackbottom;
|
|
68
67
|
@property (strong, nonatomic) IBOutlet UIImageView *progress;
|
|
68
|
+
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *fullscreenPreviewLayer;
|
|
69
69
|
|
|
70
70
|
// Session management.
|
|
71
71
|
@property (nonatomic, weak) IBOutlet AVCamPreviewView *previewView;
|
|
@@ -113,7 +113,7 @@ typedef NS_ENUM( NSInteger, AVCamDepthDataDeliveryMode ) {
|
|
|
113
113
|
|
|
114
114
|
- (void)insertImgUrl:(NSString*)url{
|
|
115
115
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
116
|
-
[_okbutton setTitle
|
|
116
|
+
[_okbutton setTitle:@"OK" forState:UIControlStateNormal];
|
|
117
117
|
[_photoButton setHidden:FALSE];
|
|
118
118
|
[_progress stopAnimating];
|
|
119
119
|
[_progress setHidden:TRUE];
|
|
@@ -160,6 +160,7 @@ typedef NS_ENUM( NSInteger, AVCamDepthDataDeliveryMode ) {
|
|
|
160
160
|
|
|
161
161
|
// Set up the preview view.
|
|
162
162
|
self.previewView.session = self.session;
|
|
163
|
+
self.previewView.videoPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
|
|
163
164
|
|
|
164
165
|
// Communicate with the session and other session objects on this queue.
|
|
165
166
|
self.sessionQueue = dispatch_queue_create( "session queue", DISPATCH_QUEUE_SERIAL );
|
|
@@ -234,6 +235,14 @@ typedef NS_ENUM( NSInteger, AVCamDepthDataDeliveryMode ) {
|
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
|
|
238
|
+
- (void)viewDidLayoutSubviews
|
|
239
|
+
{
|
|
240
|
+
[super viewDidLayoutSubviews];
|
|
241
|
+
if (self.fullscreenPreviewLayer) {
|
|
242
|
+
self.fullscreenPreviewLayer.frame = _rootView.bounds;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
237
246
|
- (void)viewWillAppear:(BOOL)animated
|
|
238
247
|
{
|
|
239
248
|
[super viewWillAppear:animated];
|
|
@@ -268,11 +277,14 @@ typedef NS_ENUM( NSInteger, AVCamDepthDataDeliveryMode ) {
|
|
|
268
277
|
}
|
|
269
278
|
|
|
270
279
|
}];
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
280
|
+
// Remove old preview layer if any (e.g. on re-appear)
|
|
281
|
+
if (self.fullscreenPreviewLayer) {
|
|
282
|
+
[self.fullscreenPreviewLayer removeFromSuperlayer];
|
|
283
|
+
}
|
|
284
|
+
self.fullscreenPreviewLayer = [AVCaptureVideoPreviewLayer layerWithSession:self.session];
|
|
285
|
+
self.fullscreenPreviewLayer.frame = _rootView.bounds;
|
|
286
|
+
self.fullscreenPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
|
|
287
|
+
[_rootView.layer addSublayer:self.fullscreenPreviewLayer];
|
|
276
288
|
_photoButton.imageView.layer.zPosition = 1;
|
|
277
289
|
_photoButton.layer.zPosition = 1;
|
|
278
290
|
_imageview.layer.zPosition = 1;
|
package/src/ios/multicam.xib
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="
|
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="24506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
|
3
3
|
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
|
4
4
|
<dependencies>
|
|
5
|
-
<
|
|
6
|
-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
|
|
5
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24504"/>
|
|
7
6
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
|
8
7
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
|
9
8
|
</dependencies>
|
|
@@ -13,9 +12,10 @@
|
|
|
13
12
|
<view contentMode="scaleToFill" id="2Si-cO-KSW">
|
|
14
13
|
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
|
15
14
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
15
|
+
<color key="backgroundColor" white="0" alpha="0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
|
16
16
|
<subviews>
|
|
17
17
|
<view hidden="YES" tag="11" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SRs-0J-vwF">
|
|
18
|
-
<rect key="frame" x="0.0" y="
|
|
18
|
+
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
|
|
19
19
|
<subviews>
|
|
20
20
|
<label opaque="NO" userInteractionEnabled="NO" tag="13" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Dessiner sur cette photo" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3SW-lA-FXP">
|
|
21
21
|
<rect key="frame" x="144" y="11" width="187" height="21"/>
|
|
@@ -62,13 +62,30 @@
|
|
|
62
62
|
</constraints>
|
|
63
63
|
</imageView>
|
|
64
64
|
<button opaque="NO" tag="2" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="utO-5P-M5r">
|
|
65
|
-
<rect key="frame" x="
|
|
65
|
+
<rect key="frame" x="311" y="598" width="44" height="44"/>
|
|
66
66
|
<constraints>
|
|
67
|
-
<constraint firstAttribute="height" constant="
|
|
67
|
+
<constraint firstAttribute="height" constant="44" id="tsh-0X-lyK"/>
|
|
68
|
+
<constraint firstAttribute="width" constant="44" id="utO-w-44w"/>
|
|
68
69
|
</constraints>
|
|
69
|
-
<
|
|
70
|
-
|
|
70
|
+
<color key="backgroundColor" red="0.6" green="0.6" blue="0.6" alpha="0.8" colorSpace="calibratedRGB"/>
|
|
71
|
+
<state key="normal" title="X">
|
|
72
|
+
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
|
71
73
|
</state>
|
|
74
|
+
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
|
|
75
|
+
<userDefinedRuntimeAttributes>
|
|
76
|
+
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
|
77
|
+
<real key="value" value="22"/>
|
|
78
|
+
</userDefinedRuntimeAttribute>
|
|
79
|
+
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds">
|
|
80
|
+
<boolean key="value" value="YES"/>
|
|
81
|
+
</userDefinedRuntimeAttribute>
|
|
82
|
+
<userDefinedRuntimeAttribute type="number" keyPath="layer.borderWidth">
|
|
83
|
+
<real key="value" value="2"/>
|
|
84
|
+
</userDefinedRuntimeAttribute>
|
|
85
|
+
<userDefinedRuntimeAttribute type="color" keyPath="layer.borderColor">
|
|
86
|
+
<color key="value" white="0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
|
87
|
+
</userDefinedRuntimeAttribute>
|
|
88
|
+
</userDefinedRuntimeAttributes>
|
|
72
89
|
</button>
|
|
73
90
|
<button opaque="NO" tag="1" contentMode="center" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f3a-n0-68n">
|
|
74
91
|
<rect key="frame" x="162.5" y="592" width="50" height="50"/>
|
|
@@ -94,8 +111,7 @@
|
|
|
94
111
|
<constraint firstItem="w0n-Df-NWM" firstAttribute="bottom" secondItem="f3a-n0-68n" secondAttribute="bottom" constant="25" id="Oi4-t0-CQ6"/>
|
|
95
112
|
<constraint firstItem="f3a-n0-68n" firstAttribute="centerX" secondItem="2Si-cO-KSW" secondAttribute="centerX" id="SUH-d2-dsP"/>
|
|
96
113
|
<constraint firstItem="w0n-Df-NWM" firstAttribute="bottom" secondItem="utO-5P-M5r" secondAttribute="bottom" constant="35" id="Sx5-aI-blt"/>
|
|
97
|
-
<constraint firstItem="
|
|
98
|
-
<constraint firstItem="SRs-0J-vwF" firstAttribute="top" secondItem="w0n-Df-NWM" secondAttribute="top" id="aoW-sr-zz9"/>
|
|
114
|
+
<constraint firstItem="w0n-Df-NWM" firstAttribute="trailing" secondItem="utO-5P-M5r" secondAttribute="trailing" constant="20" id="WjK-KC-LQF"/>
|
|
99
115
|
<constraint firstItem="SRs-0J-vwF" firstAttribute="trailing" secondItem="w0n-Df-NWM" secondAttribute="trailing" id="nVN-7W-wYt"/>
|
|
100
116
|
<constraint firstItem="WzM-XN-do1" firstAttribute="centerX" secondItem="2Si-cO-KSW" secondAttribute="centerX" id="sAe-d3-TMO"/>
|
|
101
117
|
<constraint firstItem="w0n-Df-NWM" firstAttribute="bottom" secondItem="Yg9-0S-pJv" secondAttribute="bottom" constant="25" id="uoV-VQ-OE3"/>
|