Dialer: use video icon when video policy is automatically start

This commit is contained in:
Gautier Pelloux-Prayer 2015-10-26 10:51:47 +01:00
parent 6b38a32b88
commit 22340a54cc
5 changed files with 24 additions and 25 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14F1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
@ -322,10 +322,10 @@
<image name="call_start_body_over.png" width="51" height="51"/>
<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="1" height="1"/>
<image name="color_E.png" width="1" height="1"/>
<image name="color_F.png" width="1" height="1"/>
<image name="color_L.png" width="1" height="1"/>
<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"/>
<image name="color_L.png" width="2" height="2"/>
<image name="contact_add_default.png" width="34" height="29"/>
<image name="contact_add_disabled.png" width="34" height="29"/>
<image name="numpad_0.png" width="52" height="48"/>

View file

@ -326,24 +326,12 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)callUpdate:(LinphoneCall *)call state:(LinphoneCallState)state {
LinphoneCore *lc = [LinphoneManager getLc];
if (linphone_core_get_calls_nb(lc) > 0) {
if (transferMode) {
[addCallButton setHidden:true];
[transferButton setHidden:false];
} else {
[addCallButton setHidden:false];
[transferButton setHidden:true];
}
[callButton setHidden:true];
[backButton setHidden:false];
[addContactButton setHidden:true];
} else {
[addCallButton setHidden:true];
[callButton setHidden:false];
[backButton setHidden:true];
[addContactButton setHidden:false];
[transferButton setHidden:true];
}
BOOL callInProgress = (linphone_core_get_calls_nb(lc) > 0);
addCallButton.hidden = (!callInProgress || transferMode);
transferButton.hidden = (!callInProgress || !transferMode);
addContactButton.hidden = callButton.hidden = callInProgress;
backButton.hidden = !callInProgress;
[callButton updateVideoPolicy];
}
- (void)setAddress:(NSString *)address {

View file

@ -1912,8 +1912,6 @@ static void audioRouteChangeListenerCallback(void *inUserData, // 1
[error show];
} else {
// Finally we can make the call
LinphoneProxyConfig *proxyCfg;
linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg);
LinphoneCallParams *lcallParams = linphone_core_create_default_call_parameters(theLinphoneCore);
if ([self lpConfigBoolForKey:@"edge_opt_preference"] && (self.network == network_2g)) {
LOGI(@"Enabling low bandwidth mode");

View file

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

View file

@ -93,4 +93,15 @@
}
}
- (void)updateVideoPolicy {
if (linphone_core_get_video_policy([LinphoneManager getLc])->automatically_initiate) {
[self setImage:[UIImage imageNamed:@"call_video_start_default.png"] forState:UIControlStateNormal];
[self setImage:[UIImage imageNamed:@"call_video_start_over.png"] forState:UIControlStateHighlighted];
[self setImage:[UIImage imageNamed:@"call_video_start_disabled.png"] forState:UIControlStateDisabled];
} else {
[self setImage:[UIImage imageNamed:@"call_start_body_default.png"] forState:UIControlStateNormal];
[self setImage:[UIImage imageNamed:@"call_start_body_over.png"] forState:UIControlStateHighlighted];
[self setImage:[UIImage imageNamed:@"call_start_body_disabled.png"] forState:UIControlStateDisabled];
}
}
@end