UI: fix call buttons when we are in transfer mode

This commit is contained in:
Gautier Pelloux-Prayer 2016-01-20 16:41:32 +01:00
parent 1ce1a76d91
commit 16fc500a96
9 changed files with 6 additions and 202 deletions

View file

@ -7,7 +7,6 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DialerView">
<connections>
<outlet property="addCallButton" destination="184" id="227"/>
<outlet property="addContactButton" destination="222" id="225"/>
<outlet property="addressField" destination="4" id="205"/>
<outlet property="backButton" destination="183" id="d75-ly-K6w"/>
@ -26,7 +25,6 @@
<outlet property="sixButton" destination="33" id="196"/>
<outlet property="starButton" destination="39" id="199"/>
<outlet property="threeButton" destination="29" id="193"/>
<outlet property="transferButton" destination="236" id="253"/>
<outlet property="twoButton" destination="37" id="192"/>
<outlet property="view" destination="171" id="176"/>
<outlet property="zeroButton" destination="40" id="198"/>
@ -289,34 +287,6 @@
<outlet property="addressField" destination="4" id="235"/>
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="236" userLabel="transferButton" customClass="UITransferButton">
<rect key="frame" x="180" y="0.0" width="360" height="66"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Transfer call"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="call_transfer_default.png" backgroundImage="color_A.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="call_transfer_disabled.png"/>
<state key="highlighted" backgroundImage="color_L.png"/>
<connections>
<outlet property="addressField" destination="4" id="237"/>
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="184" userLabel="addCallButton" customClass="UICallButton">
<rect key="frame" x="180" y="0.0" width="360" height="66"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Add call"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="call_add_default.png" backgroundImage="color_A.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="call_add_disabled.png"/>
<state key="highlighted" backgroundImage="color_L.png"/>
<connections>
<outlet property="addressField" destination="4" id="234"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
@ -333,14 +303,10 @@
<image name="backspace_default.png" width="36" height="19"/>
<image name="backspace_disabled.png" width="36" height="19"/>
<image name="backspace_over.png" width="36" height="19"/>
<image name="call_add_default.png" width="39" height="35"/>
<image name="call_add_disabled.png" width="39" height="35"/>
<image name="call_alt_back_default.png" width="50" height="36"/>
<image name="call_alt_back_disabled.png" width="50" height="36"/>
<image name="call_audio_start_default.png" width="36" height="36"/>
<image name="call_audio_start_disabled.png" width="36" height="36"/>
<image name="call_transfer_default.png" width="40" height="36"/>
<image name="call_transfer_disabled.png" width="40" height="36"/>
<image name="color_A.png" width="2" height="2"/>
<image name="color_E.png" width="2" height="2"/>
<image name="color_F.png" width="2" height="2"/>

View file

@ -7,7 +7,6 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DialerView">
<connections>
<outlet property="addCallButton" destination="184" id="227"/>
<outlet property="addContactButton" destination="222" id="225"/>
<outlet property="addressField" destination="4" id="205"/>
<outlet property="backButton" destination="183" id="d75-ly-K6w"/>
@ -25,7 +24,6 @@
<outlet property="sixButton" destination="33" id="196"/>
<outlet property="starButton" destination="39" id="199"/>
<outlet property="threeButton" destination="29" id="193"/>
<outlet property="transferButton" destination="236" id="253"/>
<outlet property="twoButton" destination="37" id="192"/>
<outlet property="videoPreview" destination="30b-JN-Ibj" id="Kwj-av-WIg"/>
<outlet property="view" destination="171" id="176"/>
@ -302,34 +300,6 @@
<outlet property="addressField" destination="4" id="235"/>
</connections>
</button>
<button hidden="YES" opaque="NO" tag="26" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="236" userLabel="transferButton" customClass="UITransferButton">
<rect key="frame" x="102" y="0.0" width="208" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Transfer call"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="call_transfer_default.png" backgroundImage="color_A.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="call_transfer_disabled.png"/>
<state key="highlighted" backgroundImage="color_L.png"/>
<connections>
<outlet property="addressField" destination="4" id="237"/>
</connections>
</button>
<button hidden="YES" opaque="NO" tag="27" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="184" userLabel="addCallButton" customClass="UICallButton">
<rect key="frame" x="102" y="0.0" width="208" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Add call"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="call_add_default.png" backgroundImage="color_A.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="call_add_disabled.png"/>
<state key="highlighted" backgroundImage="color_L.png"/>
<connections>
<outlet property="addressField" destination="4" id="234"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
@ -628,34 +598,6 @@
<outlet property="addressField" destination="Omx-NU-xKz" id="L5w-fg-hu4"/>
</connections>
</button>
<button hidden="YES" opaque="NO" tag="26" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="sgE-tf-F5m" userLabel="transferButton" customClass="UITransferButton">
<rect key="frame" x="101" y="0.0" width="207" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Transfer call"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="call_transfer_default.png" backgroundImage="color_A.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="call_transfer_disabled.png"/>
<state key="highlighted" backgroundImage="color_L.png"/>
<connections>
<outlet property="addressField" destination="Omx-NU-xKz" id="SO9-Af-1mi"/>
</connections>
</button>
<button hidden="YES" opaque="NO" tag="27" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="4rB-ub-Jg9" userLabel="addCallButton" customClass="UICallButton">
<rect key="frame" x="101" y="0.0" width="207" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Add call"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="call_add_default.png" backgroundImage="color_A.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="call_add_disabled.png"/>
<state key="highlighted" backgroundImage="color_L.png"/>
<connections>
<outlet property="addressField" destination="Omx-NU-xKz" id="WsE-IC-wXp"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
@ -691,14 +633,10 @@
<image name="backspace_default.png" width="36" height="19"/>
<image name="backspace_disabled.png" width="36" height="19"/>
<image name="backspace_over.png" width="36" height="19"/>
<image name="call_add_default.png" width="39" height="35"/>
<image name="call_add_disabled.png" width="39" height="35"/>
<image name="call_alt_back_default.png" width="50" height="36"/>
<image name="call_alt_back_disabled.png" width="50" height="36"/>
<image name="call_audio_start_default.png" width="36" height="36"/>
<image name="call_audio_start_disabled.png" width="36" height="36"/>
<image name="call_transfer_default.png" width="40" height="36"/>
<image name="call_transfer_disabled.png" width="40" height="36"/>
<image name="camera_switch_default.png" width="51" height="50"/>
<image name="camera_switch_disabled.png" width="51" height="50"/>
<image name="camera_switch_over.png" width="51" height="50"/>

View file

@ -23,7 +23,6 @@
#import "UICamSwitch.h"
#import "UICallButton.h"
#import "UITransferButton.h"
#import "UIDigitButton.h"
@interface DialerView
@ -38,7 +37,7 @@
@property(nonatomic, strong) IBOutlet UIButton *addContactButton;
@property(nonatomic, strong) IBOutlet UICallButton *callButton;
@property(nonatomic, strong) IBOutlet UICallButton *addCallButton;
@property(nonatomic, strong) IBOutlet UITransferButton *transferButton;
@property(nonatomic, strong) IBOutlet UICallButton *transferButton;
@property(nonatomic, strong) IBOutlet UIButton *backButton;
@property(weak, nonatomic) IBOutlet UIIconButton *backspaceButton;

View file

@ -333,7 +333,7 @@ static UICompositeViewDescription *compositeDescription = nil;
transferButton.hidden = (!callInProgress || !transferMode);
addContactButton.hidden = callButton.hidden = callInProgress;
backButton.hidden = !callInProgress;
[callButton updateVideoPolicy];
[callButton updateIcon];
}
- (void)setAddress:(NSString *)address {

View file

@ -26,6 +26,6 @@
@property(nonatomic, strong) IBOutlet UITextField *addressField;
- (void)updateVideoPolicy;
- (void)updateIcon;
@end

View file

@ -93,7 +93,7 @@
}
}
- (void)updateVideoPolicy {
- (void)updateIcon {
if (linphone_core_video_capture_enabled(LC) && linphone_core_get_video_policy(LC)->automatically_initiate) {
[self setImage:[UIImage imageNamed:@"call_video_start_default.png"] forState:UIControlStateNormal];
[self setImage:[UIImage imageNamed:@"call_video_start_disabled.png"] forState:UIControlStateDisabled];
@ -101,5 +101,7 @@
[self setImage:[UIImage imageNamed:@"call_audio_start_default.png"] forState:UIControlStateNormal];
[self setImage:[UIImage imageNamed:@"call_audio_start_disabled.png"] forState:UIControlStateDisabled];
}
if (LinphoneManager.instance.)
}
@end

View file

@ -1,28 +0,0 @@
/* UITransferButton.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <UIKit/UIKit.h>
#import "UIIconButton.h"
@interface UITransferButton : UIIconButton
@property(nonatomic, strong) IBOutlet UITextField *addressField;
@end

View file

@ -1,67 +0,0 @@
/* UITransferButton.m
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UITransferButton.h"
#import "LinphoneManager.h"
#import <CoreTelephony/CTCallCenter.h>
@implementation UITransferButton
@synthesize addressField;
#pragma mark - Lifecycle Functions
- (void)initUICallButton {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}
- (id)init {
self = [super init];
if (self) {
[self initUICallButton];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUICallButton];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initUICallButton];
}
return self;
}
#pragma mark -
- (void)touchUp:(id)sender {
LinphoneAddress *addr = linphone_core_interpret_url(LC, addressField.text.UTF8String);
[LinphoneManager.instance call:addr transfer:TRUE];
if (addr)
linphone_address_destroy(addr);
}
@end

View file

@ -567,7 +567,6 @@
D30562161671DC4900C97967 /* libXMLRPC.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3554ED115CA79AA00478841 /* libXMLRPC.a */; };
D306459E1611EC2A00BB571E /* UILoadingImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = D306459D1611EC2900BB571E /* UILoadingImageView.m */; };
D3128FE115AABC7E00A2147A /* ContactDetailsView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3128FDF15AABC7E00A2147A /* ContactDetailsView.m */; };
D3196D3E15A32BD8007FEEBA /* UITransferButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D3196D3D15A32BD8007FEEBA /* UITransferButton.m */; };
D31AAF5E159B3919002C6B02 /* CallPausedTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D31AAF5D159B3919002C6B02 /* CallPausedTableView.m */; };
D31B4B21159876C0002E6C72 /* UICompositeView.m in Sources */ = {isa = PBXBuildFile; fileRef = D31B4B1F159876C0002E6C72 /* UICompositeView.m */; };
D31C9C98158A1CDF00756B45 /* UIHistoryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D31C9C97158A1CDE00756B45 /* UIHistoryCell.m */; };
@ -1392,8 +1391,6 @@
D30BF33216A427BC00AF0026 /* libtunnel.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtunnel.a; path = "liblinphone-sdk/apple-darwin/lib/libtunnel.a"; sourceTree = "<group>"; };
D3128FDE15AABC7E00A2147A /* ContactDetailsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailsView.h; sourceTree = "<group>"; };
D3128FDF15AABC7E00A2147A /* ContactDetailsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailsView.m; sourceTree = "<group>"; };
D3196D3C15A32BD7007FEEBA /* UITransferButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITransferButton.h; sourceTree = "<group>"; };
D3196D3D15A32BD8007FEEBA /* UITransferButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UITransferButton.m; sourceTree = "<group>"; };
D31AAF5C159B3919002C6B02 /* CallPausedTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallPausedTableView.h; sourceTree = "<group>"; };
D31AAF5D159B3919002C6B02 /* CallPausedTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallPausedTableView.m; sourceTree = "<group>"; };
D31B4B1E159876C0002E6C72 /* UICompositeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICompositeView.h; sourceTree = "<group>"; };
@ -1928,8 +1925,6 @@
F03CA84218C72F1A0008889D /* UITextViewNoDefine.m */,
D32648421588F6FA00930C67 /* UIToggleButton.h */,
D32648431588F6FB00930C67 /* UIToggleButton.m */,
D3196D3C15A32BD7007FEEBA /* UITransferButton.h */,
D3196D3D15A32BD8007FEEBA /* UITransferButton.m */,
340751E5150F38FC00B89C47 /* UIVideoButton.h */,
340751E6150F38FD00B89C47 /* UIVideoButton.m */,
6381DA7B1C1AD5EA00DF3BBD /* UIBouncingView.h */,
@ -3474,7 +3469,6 @@
D31B4B21159876C0002E6C72 /* UICompositeView.m in Sources */,
D31AAF5E159B3919002C6B02 /* CallPausedTableView.m in Sources */,
D32B9DFC15A2F131000B6DEC /* FastAddressBook.m in Sources */,
D3196D3E15A32BD8007FEEBA /* UITransferButton.m in Sources */,
D350F20E15A43BB100149E54 /* AssistantView.m in Sources */,
D3F795D615A582810077328B /* ChatConversationView.m in Sources */,
D32B6E2915A5BC440033019F /* ChatConversationTableView.m in Sources */,