Skip to content
44 changes: 23 additions & 21 deletions Classes/InCall.storyboard
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="i7c-Y5-iNb">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="i7c-Y5-iNb">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
Expand Down Expand Up @@ -38,17 +38,6 @@
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<view clearsContextBeforeDrawing="NO" userInteractionEnabled="NO" contentMode="scaleAspectFit" translatesAutoresizingMaskIntoConstraints="NO" id="HJr-Bj-pWa" userLabel="View - Preview">
<rect key="frame" x="243" y="379" width="96" height="128"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<accessibility key="accessibilityConfiguration" identifier="previewView" label="View - Preview">
<bool key="isElement" value="YES"/>
</accessibility>
<constraints>
<constraint firstAttribute="width" constant="96" id="X3X-WX-q0U"/>
<constraint firstAttribute="height" constant="128" id="v5A-Rj-kxk"/>
</constraints>
</view>
<view alpha="0.0" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0Fx-gY-047" customClass="SecondIncomingCallBarView">
<rect key="frame" x="0.0" y="547" width="375" height="120"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -170,6 +159,21 @@
<constraint firstAttribute="height" constant="253" id="y1L-DJ-MMn"/>
</constraints>
</view>
<view clearsContextBeforeDrawing="NO" contentMode="scaleAspectFit" translatesAutoresizingMaskIntoConstraints="NO" id="HJr-Bj-pWa" userLabel="View - Preview">
<rect key="frame" x="243" y="379" width="96" height="128"/>
<color key="backgroundColor" red="1" green="0.1960784314" blue="0.29411764709999999" alpha="1" colorSpace="calibratedRGB"/>
<accessibility key="accessibilityConfiguration" identifier="previewView" label="View - Preview">
<bool key="isElement" value="YES"/>
</accessibility>
<gestureRecognizers/>
<constraints>
<constraint firstAttribute="width" constant="96" id="X3X-WX-q0U"/>
<constraint firstAttribute="height" constant="128" id="v5A-Rj-kxk"/>
</constraints>
<connections>
<outletCollection property="gestureRecognizers" destination="AIl-a1-pYw" appends="YES" id="5K4-aU-OIy"/>
</connections>
</view>
<view multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="R3N-QA-id6" customClass="InCallOnHoldView">
<rect key="frame" x="0.0" y="23" width="375" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -268,7 +272,6 @@
<constraint firstAttribute="trailing" secondItem="9ev-fs-CZO" secondAttribute="trailing" constant="1" id="TNY-hQ-eUW"/>
<constraint firstItem="R3N-QA-id6" firstAttribute="top" secondItem="KQf-7a-Dtr" secondAttribute="bottom" id="Tu1-NH-IVI"/>
<constraint firstItem="5T0-dS-AZx" firstAttribute="top" secondItem="YgE-gZ-e8E" secondAttribute="bottom" id="V9t-fN-cCV"/>
<constraint firstItem="qgE-uq-Pbv" firstAttribute="top" relation="greaterThanOrEqual" secondItem="cto-wd-TgW" secondAttribute="bottom" constant="120" id="VLA-Wq-kPT"/>
<constraint firstItem="lNU-6W-eeL" firstAttribute="leading" secondItem="dGF-2k-5Y3" secondAttribute="leading" id="YdS-A7-bKu"/>
<constraint firstItem="qgE-uq-Pbv" firstAttribute="top" secondItem="zyC-b4-pSa" secondAttribute="bottom" id="YrC-VC-PnZ"/>
<constraint firstItem="KnW-eL-D0c" firstAttribute="width" secondItem="dGF-2k-5Y3" secondAttribute="width" multiplier="0.9" id="Z8c-33-fvD"/>
Expand All @@ -295,7 +298,6 @@
<constraint firstItem="zyC-b4-pSa" firstAttribute="width" secondItem="dGF-2k-5Y3" secondAttribute="width" multiplier="0.9" id="obd-1d-bsL"/>
<constraint firstItem="cik-39-glU" firstAttribute="top" secondItem="dGF-2k-5Y3" secondAttribute="topMargin" constant="25" id="q2N-OR-LX0"/>
<constraint firstItem="KQf-7a-Dtr" firstAttribute="leading" secondItem="dGF-2k-5Y3" secondAttribute="leading" id="qzK-xp-Wo1"/>
<constraint firstItem="cto-wd-TgW" firstAttribute="top" relation="greaterThanOrEqual" secondItem="YgE-gZ-e8E" secondAttribute="bottom" constant="70" id="vG6-i3-YNy"/>
<constraint firstItem="Flh-2b-FH0" firstAttribute="top" secondItem="KQf-7a-Dtr" secondAttribute="bottom" id="vS9-gS-3dN"/>
<constraint firstItem="RGY-s2-faC" firstAttribute="top" secondItem="YgE-gZ-e8E" secondAttribute="bottom" id="wWm-8q-5PN"/>
<constraint firstItem="zyC-b4-pSa" firstAttribute="centerX" secondItem="dGF-2k-5Y3" secondAttribute="centerX" id="xD0-MW-WtB"/>
Expand All @@ -304,12 +306,6 @@
<constraint firstItem="qgE-uq-Pbv" firstAttribute="top" relation="greaterThanOrEqual" secondItem="KnW-eL-D0c" secondAttribute="bottom" constant="5" id="zCH-3W-1Cx"/>
<constraint firstItem="R3N-QA-id6" firstAttribute="leading" secondItem="dGF-2k-5Y3" secondAttribute="leading" id="zmh-rH-O6k"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="vG6-i3-YNy"/>
<exclude reference="VLA-Wq-kPT"/>
</mask>
</variation>
<connections>
<outletCollection property="gestureRecognizers" destination="roq-mU-HSX" appends="YES" id="8Sf-M2-cwv"/>
</connections>
Expand Down Expand Up @@ -341,12 +337,18 @@
<outlet property="videoPreviewHeightConstraint" destination="v5A-Rj-kxk" id="YD8-DJ-q5m"/>
<outlet property="videoPreviewView" destination="HJr-Bj-pWa" id="cjI-2X-uJk"/>
<outlet property="videoPreviewViewBottomConstraint" destination="M6j-lE-fXg" id="i6Q-W1-Ril"/>
<outlet property="videoPreviewViewTrailingConstraint" destination="d23-vm-O6v" id="4ZN-92-rIq"/>
<outlet property="videoPreviewWidthConstraint" destination="X3X-WX-q0U" id="Q8q-Ef-osM"/>
<outlet property="videoView" destination="5T0-dS-AZx" id="gzW-X8-EHG"/>
<outlet property="viewCallDeclinedWithMessage" destination="oyW-qp-rbg" id="aWO-tj-Kx7"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="xHw-Fm-20Z" userLabel="First Responder" sceneMemberID="firstResponder"/>
<panGestureRecognizer minimumNumberOfTouches="1" id="AIl-a1-pYw">
<connections>
<action selector="videoPreviewPanGestureHandler:" destination="i7c-Y5-iNb" id="yLN-Qc-5v2"/>
</connections>
</panGestureRecognizer>
<tapGestureRecognizer id="roq-mU-HSX">
<connections>
<action selector="singleTapped:" destination="i7c-Y5-iNb" id="kDC-sK-70W"/>
Expand All @@ -358,6 +360,6 @@
</scenes>
<resources>
<image name="Hold.png" width="400" height="100"/>
<image name="camera_mute.png" width="209" height="136"/>
<image name="camera_mute.png" width="151" height="51"/>
</resources>
</document>
56 changes: 42 additions & 14 deletions Classes/InCallViewControllerNew.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ @interface InCallViewControllerNew () <UITableViewDelegate, UITableViewDataSourc
@property (weak, nonatomic) IBOutlet UIView *videoView;
@property (weak, nonatomic) IBOutlet UIView *videoPreviewView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *videoPreviewViewBottomConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *videoPreviewViewTrailingConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *videoPreviewHeightConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *videoPreviewWidthConstraint;
@property (weak, nonatomic) IBOutlet CallBarView *callBarView;
Expand Down Expand Up @@ -710,7 +711,7 @@ - (void)setupCallBarView {

if(strcmp(linphone_address_get_username(remoteAddr), "911") == 0){
[[LinphoneManager instance] enableCameraForCurrentCall];
[self setupVideoButtonState];
[weakSelf setupVideoButtonState];
return;
}

Expand All @@ -736,7 +737,7 @@ - (void)setupCallBarView {

if(strcmp(linphone_address_get_username(remoteAddr), "911") == 0){
[[LinphoneManager instance] enableMicrophone];
[self setupMicriphoneButtonState];
[weakSelf setupMicriphoneButtonState];
return;
}

Expand All @@ -752,16 +753,17 @@ - (void)setupCallBarView {

self.callBarView.keypadButtonActionHandler = ^(UIButton *sender) {

if (self.inCallDialpadView.viewState == VS_Closed) {
if (weakSelf.inCallDialpadView.viewState == VS_Closed) {

self.inCallDialpadViewContainer.hidden = NO;
[weakSelf.view bringSubviewToFront:weakSelf.inCallDialpadViewContainer];
weakSelf.inCallDialpadViewContainer.hidden = NO;
sender.selected = YES;
[weakSelf.inCallDialpadView showWithAnimation:YES completion:nil];
}
else if (self.inCallDialpadView.viewState == VS_Opened) {
else if (weakSelf.inCallDialpadView.viewState == VS_Opened) {

sender.selected = NO;
self.inCallDialpadViewContainer.hidden = YES;
weakSelf.inCallDialpadViewContainer.hidden = YES;
[weakSelf.inCallDialpadView hideWithAnimation:YES completion:nil];
}
};
Expand Down Expand Up @@ -800,21 +802,34 @@ - (void)setupCallBarView {

self.callBarView.chatButtonActionHandler = ^(UIButton *sender) {

if (self.isRTTEnabled) {
[self hideRTTContainer];
self.isChatMode = YES;
self.tableView.hidden = NO;
[self.tableView reloadData];
[self becomeFirstResponder];
if (weakSelf.isRTTEnabled) {
[weakSelf hideRTTContainer];
weakSelf.isChatMode = YES;
weakSelf.tableView.hidden = NO;
[weakSelf.tableView reloadData];
[weakSelf becomeFirstResponder];
}
};

self.callBarView.endCallButtonActionHandler = ^(UIButton *sender) {

[[LinphoneManager instance] terminateCurrentCall];
if(linphone_core_get_calls_nb([LinphoneManager getLc]) == 0){
[self close];
if(linphone_core_get_calls_nb([LinphoneManager getLc]) == 0) {
[weakSelf close];
}
};

self.callBarView.moreButtonActionHandler = ^(UIButton *sender) {

if (sender.selected) {

[weakSelf.view bringSubviewToFront:weakSelf.callBarView];
}
else {

[weakSelf.view bringSubviewToFront:weakSelf.videoPreviewView];
}

};
}

Expand Down Expand Up @@ -1047,6 +1062,8 @@ - (void)setupCallInfoView {
__weak InCallViewControllerNew *weakSelf = self;
self.statusBar.statusBarActionHandler = ^(UIButton *sender) {
if (weakSelf.callInfoView.viewState == VS_Closed) {

[weakSelf.view bringSubviewToFront:weakSelf.callInfoView];
[weakSelf.callInfoView showWithAnimation:YES completion:nil];
}
else if (weakSelf.callInfoView.viewState == VS_Opened) {
Expand Down Expand Up @@ -1191,6 +1208,17 @@ - (IBAction)singleTapped:(UITapGestureRecognizer *)sender {
}
}

- (IBAction)videoPreviewPanGestureHandler:(UIPanGestureRecognizer *)sender {

CGPoint translation = [sender translationInView:self.view];
sender.view.center = CGPointMake(sender.view.center.x + translation.x,
sender.view.center.y + translation.y);
[sender setTranslation:CGPointMake(0, 0) inView:self.view];

self.videoPreviewViewBottomConstraint.constant += -translation.y;
self.videoPreviewViewTrailingConstraint.constant += -translation.x;
}

- (IBAction)closeButtonAction:(id)sender {

[self hideRTTContainer];
Expand Down
2 changes: 1 addition & 1 deletion linphone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5031,7 +5031,7 @@
LastUpgradeCheck = 0700;
TargetAttributes = {
1D6058900D05DD3D006BFB54 = {
DevelopmentTeam = N35DF75MHS;
DevelopmentTeam = SJGPQWR594;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert the file.

SystemCapabilities = {
com.apple.InAppPurchase = {
enabled = 0;
Expand Down