mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Call: more work on paused calls
This commit is contained in:
parent
ca4f7356db
commit
47425e6882
8 changed files with 180 additions and 115 deletions
|
|
@ -17,6 +17,7 @@
|
|||
<outlet property="microButton" destination="pRH-Ao-h65" id="F5a-sf-J7B"/>
|
||||
<outlet property="nameLabel" destination="KPa-Rm-Qni" id="KiX-oL-MUd"/>
|
||||
<outlet property="nineButton" destination="b8R-7P-jHK" id="LNS-eb-9bc"/>
|
||||
<outlet property="noActiveCallView" destination="aqL-q2-eR2" id="quL-ZA-BeK"/>
|
||||
<outlet property="numpadButton" destination="SRu-dB-r3e" id="Y2q-lE-f89"/>
|
||||
<outlet property="numpadView" destination="ukG-i4-YMY" id="f2R-OM-ahP"/>
|
||||
<outlet property="oneButton" destination="qZ8-m9-B0N" id="eOL-0X-pTJ"/>
|
||||
|
|
@ -26,6 +27,7 @@
|
|||
<outlet property="optionsTransferButton" destination="S0k-bn-1bs" id="2fo-RR-nKy"/>
|
||||
<outlet property="optionsView" destination="sHZ-53-Hta" id="HjK-Gc-HB2"/>
|
||||
<outlet property="pauseButton" destination="7f5-7T-fV3" id="c3P-vq-8ux"/>
|
||||
<outlet property="pausedByRemoteView" destination="0MR-ml-8RY" id="fzQ-lE-Tny"/>
|
||||
<outlet property="pausedCallsTableView" destination="162" id="4Zj-Gb-Pdt"/>
|
||||
<outlet property="routesBluetoothButton" destination="6uv-FV-mUL" id="c0F-7q-0m5"/>
|
||||
<outlet property="routesButton" destination="nQp-5y-kTy" id="2u8-g5-6T1"/>
|
||||
|
|
@ -69,28 +71,28 @@
|
|||
<rect key="frame" x="0.0" y="0.0" width="375" height="503"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" tag="7" contentMode="scaleAspectFit" image="avatar.png" id="fZy-K5-yQp" userLabel="avatarImage" customClass="UIRoundedImageView">
|
||||
<rect key="frame" x="46" y="110" width="283" height="283"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact avatar">
|
||||
<accessibilityTraits key="traits" none="YES" image="YES" notEnabled="YES"/>
|
||||
<bool key="isElement" value="YES"/>
|
||||
</accessibility>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="KPa-Rm-Qni" userLabel="nameLabel">
|
||||
<rect key="frame" x="46" y="400" width="283" height="32"/>
|
||||
<rect key="frame" x="46" y="50" width="283" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="37"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="01:34" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Oy8-QO-Jwb" userLabel="durationLabel">
|
||||
<rect key="frame" x="0.0" y="450" width="375" height="40"/>
|
||||
<rect key="frame" x="0.0" y="70" width="375" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" tag="7" contentMode="scaleAspectFit" image="avatar.png" id="fZy-K5-yQp" userLabel="avatarImage" customClass="UIRoundedImageView">
|
||||
<rect key="frame" x="46" y="130" width="283" height="283"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact avatar">
|
||||
<accessibilityTraits key="traits" none="YES" image="YES" notEnabled="YES"/>
|
||||
<bool key="isElement" value="YES"/>
|
||||
</accessibility>
|
||||
</imageView>
|
||||
<view hidden="YES" contentMode="scaleToFill" id="126" userLabel="video">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="503"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
|
|
@ -135,6 +137,24 @@
|
|||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<view hidden="YES" alpha="0.80000000000000004" contentMode="scaleToFill" id="0MR-ml-8RY" userLabel="pausedByRemoteView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="503"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="waiting_time.png" id="DH6-pH-W9j" userLabel="pausedImage">
|
||||
<rect key="frame" x="0.0" y="200" width="375" height="71"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="You are paused by remote" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="OgZ-xf-k7s" userLabel="pausedLabel">
|
||||
<rect key="frame" x="0.0" y="241" width="375" height="100"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.2666666667" green="0.2666666667" blue="0.2666666667" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
<button opaque="NO" tag="24" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="7f5-7T-fV3" userLabel="pauseButton" customClass="UIPauseButton">
|
||||
<rect key="frame" x="310" y="370" width="52" height="52"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
|
|
@ -146,6 +166,24 @@
|
|||
<state key="selected" image="pause_big_over_selected.png"/>
|
||||
<state key="highlighted" image="pause_big_over_selected.png"/>
|
||||
</button>
|
||||
<view hidden="YES" contentMode="scaleToFill" id="aqL-q2-eR2" userLabel="noActiveCallView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="503"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="waiting_time.png" id="4uU-gc-9XK" userLabel="pausedImage">
|
||||
<rect key="frame" x="0.0" y="200" width="375" height="71"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="You have paused all your calls" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="b5q-sb-qbU" userLabel="pausedLabel">
|
||||
<rect key="frame" x="0.0" y="241" width="375" height="100"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.2666666667" green="0.2666666667" blue="0.2666666667" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
|
|
@ -153,8 +191,6 @@
|
|||
<rect key="frame" x="0.0" y="453" width="375" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<inset key="contentInset" minX="0.0" minY="10" maxX="0.0" maxY="25"/>
|
||||
<inset key="scrollIndicatorInsets" minX="0.0" minY="10" maxX="0.0" maxY="25"/>
|
||||
<color key="separatorColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="162" id="168"/>
|
||||
|
|
@ -567,6 +603,7 @@
|
|||
<image name="pause_big_over_selected.png" width="51" height="50"/>
|
||||
<image name="speaker_default.png" width="27" height="25"/>
|
||||
<image name="speaker_selected.png" width="27" height="25"/>
|
||||
<image name="waiting_time.png" width="59" height="71"/>
|
||||
</resources>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
|
|
|
|||
|
|
@ -49,14 +49,22 @@
|
|||
newOrigin.size.height =
|
||||
[self tableView:self.tableView heightForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]] *
|
||||
[self tableView:self.tableView numberOfRowsInSection:0];
|
||||
newOrigin.origin.y = self.tableView.frame.origin.y + self.tableView.frame.size.height - newOrigin.size.height;
|
||||
newOrigin.origin.y += self.tableView.frame.size.height - newOrigin.size.height;
|
||||
self.tableView.frame = newOrigin;
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDataSource Functions
|
||||
- (LinphoneCall *)pausedCallForRow:(NSInteger)row {
|
||||
const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]);
|
||||
return (row < ms_list_size(calls) - 1) ? ms_list_nth_data(calls, (int)row) : NULL;
|
||||
LinphoneCall *currentCall = linphone_core_get_current_call([LinphoneManager getLc]);
|
||||
int i = 0;
|
||||
while (calls && i < row) {
|
||||
if (calls->data != currentCall) {
|
||||
i++;
|
||||
}
|
||||
calls = calls->next;
|
||||
}
|
||||
return (calls ? calls->data : NULL);
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDataSource Functions
|
||||
|
|
@ -72,17 +80,14 @@
|
|||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return ms_list_size(linphone_core_get_calls([LinphoneManager getLc])) - 1;
|
||||
return ms_list_size(linphone_core_get_calls([LinphoneManager getLc])) -
|
||||
(linphone_core_get_current_call([LinphoneManager getLc]) ? 1 : 0);
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return [self tableView:tableView cellForRowAtIndexPath:indexPath].frame.size.height;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
|
||||
return 1e-5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@
|
|||
@property(weak, nonatomic) IBOutlet UIRoundedImageView *avatarImage;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *durationLabel;
|
||||
@property(weak, nonatomic) IBOutlet UIView *pausedByRemoteView;
|
||||
@property(weak, nonatomic) IBOutlet UIView *noActiveCallView;
|
||||
|
||||
- (IBAction)onRoutesClick:(id)sender;
|
||||
- (IBAction)onRoutesBluetoothClick:(id)sender;
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[self hidePad:FALSE];
|
||||
[self showSpeaker];
|
||||
[self callDurationUpdate];
|
||||
[self onCurrentCallChange];
|
||||
|
||||
// Set windows (warn memory leaks)
|
||||
linphone_core_set_native_video_window_id([LinphoneManager getLc], (__bridge void *)(_videoView));
|
||||
|
|
@ -139,14 +140,6 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
name:kLinphoneBluetoothAvailabilityUpdate
|
||||
object:nil];
|
||||
|
||||
const LinphoneAddress *addr = linphone_call_get_remote_address(call);
|
||||
[ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr];
|
||||
char *uri = linphone_address_as_string_uri_only(addr);
|
||||
_addressLabel.text = [NSString stringWithUTF8String:uri];
|
||||
ms_free(uri);
|
||||
_avatarImage.image =
|
||||
[FastAddressBook getContactImage:[FastAddressBook getContactWithLinphoneAddress:addr] thumbnail:NO];
|
||||
|
||||
[NSTimer scheduledTimerWithTimeInterval:1
|
||||
target:self
|
||||
selector:@selector(callDurationUpdate)
|
||||
|
|
@ -236,80 +229,6 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
#pragma mark -
|
||||
|
||||
- (void)callUpdate:(LinphoneCall *)call state:(LinphoneCallState)state animated:(BOOL)animated {
|
||||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
[self updateBottomBar:call state:state];
|
||||
if (hiddenVolume) {
|
||||
[PhoneMainView.instance setVolumeHidden:FALSE];
|
||||
hiddenVolume = FALSE;
|
||||
}
|
||||
|
||||
// Update table
|
||||
[_pausedCallsTableView.tableView reloadData];
|
||||
|
||||
// Fake call update
|
||||
if (call == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (state) {
|
||||
case LinphoneCallIncomingReceived:
|
||||
case LinphoneCallOutgoingInit:
|
||||
case LinphoneCallConnected:
|
||||
case LinphoneCallStreamsRunning: {
|
||||
// check video
|
||||
if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
|
||||
[self displayVideoCall:animated];
|
||||
} else {
|
||||
[self displayTableCall:animated];
|
||||
const LinphoneCallParams *param = linphone_call_get_current_params(call);
|
||||
const LinphoneCallAppData *callAppData =
|
||||
(__bridge const LinphoneCallAppData *)(linphone_call_get_user_pointer(call));
|
||||
if (state == LinphoneCallStreamsRunning && callAppData->videoRequested &&
|
||||
linphone_call_params_low_bandwidth_enabled(param)) {
|
||||
// too bad video was not enabled because low bandwidth
|
||||
UIAlertView *alert = [[UIAlertView alloc]
|
||||
initWithTitle:NSLocalizedString(@"Low bandwidth", nil)
|
||||
message:NSLocalizedString(@"Video cannot be activated because of low bandwidth "
|
||||
@"condition, only audio is available",
|
||||
nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
callAppData->videoRequested = FALSE; /*reset field*/
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LinphoneCallUpdatedByRemote: {
|
||||
const LinphoneCallParams *current = linphone_call_get_current_params(call);
|
||||
const LinphoneCallParams *remote = linphone_call_get_remote_params(call);
|
||||
|
||||
/* remote wants to add video */
|
||||
if (linphone_core_video_enabled(lc) && !linphone_call_params_video_enabled(current) &&
|
||||
linphone_call_params_video_enabled(remote) &&
|
||||
!linphone_core_get_video_policy(lc)->automatically_accept) {
|
||||
linphone_core_defer_call_update(lc, call);
|
||||
[self displayAskToEnableVideoCall:call];
|
||||
} else if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) {
|
||||
[self displayTableCall:animated];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LinphoneCallPausing:
|
||||
case LinphoneCallPaused:
|
||||
case LinphoneCallPausedByRemote: {
|
||||
[self displayTableCall:animated];
|
||||
break;
|
||||
}
|
||||
case LinphoneCallEnd:
|
||||
case LinphoneCallError:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateBottomBar:(LinphoneCall *)call state:(LinphoneCallState)state {
|
||||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
|
||||
|
|
@ -491,12 +410,11 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[_videoGroup setAlpha:0.0];
|
||||
[PhoneMainView.instance showTabBar:true];
|
||||
|
||||
UIEdgeInsets insets = {10, 0, 25, 0};
|
||||
[_pausedCallsTableView.tableView setContentInset:insets];
|
||||
[_pausedCallsTableView.tableView setScrollIndicatorInsets:insets];
|
||||
// UIEdgeInsets insets = {10, 0, 25, 0};
|
||||
// [_pausedCallsTableView.tableView setContentInset:insets];
|
||||
// [_pausedCallsTableView.tableView setScrollIndicatorInsets:insets];
|
||||
[_pausedCallsTableView.tableView setAlpha:1.0];
|
||||
|
||||
[_pausedCallsTableView.tableView setAlpha:1.0];
|
||||
[_videoCameraSwitch setHidden:TRUE];
|
||||
|
||||
if (animation) {
|
||||
|
|
@ -540,6 +458,22 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
}
|
||||
}
|
||||
|
||||
- (void)onCurrentCallChange {
|
||||
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
|
||||
if (call) {
|
||||
const LinphoneAddress *addr = linphone_call_get_remote_address(call);
|
||||
[ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr];
|
||||
char *uri = linphone_address_as_string_uri_only(addr);
|
||||
_addressLabel.text = [NSString stringWithUTF8String:uri];
|
||||
ms_free(uri);
|
||||
_avatarImage.image =
|
||||
[FastAddressBook getContactImage:[FastAddressBook getContactWithLinphoneAddress:addr] thumbnail:NO];
|
||||
_noActiveCallView.hidden = YES;
|
||||
} else {
|
||||
_noActiveCallView.hidden = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showPad:(BOOL)animated {
|
||||
[_numpadButton setOn];
|
||||
if ([_numpadView isHidden]) {
|
||||
|
|
@ -659,6 +593,93 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
[self callUpdate:call state:state animated:TRUE];
|
||||
}
|
||||
|
||||
- (void)callUpdate:(LinphoneCall *)call state:(LinphoneCallState)state animated:(BOOL)animated {
|
||||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
[self updateBottomBar:call state:state];
|
||||
if (hiddenVolume) {
|
||||
[PhoneMainView.instance setVolumeHidden:FALSE];
|
||||
hiddenVolume = FALSE;
|
||||
}
|
||||
|
||||
// Update table
|
||||
[_pausedCallsTableView.tableView reloadData];
|
||||
|
||||
static LinphoneCall *currentCall = NULL;
|
||||
if (!currentCall || linphone_core_get_current_call(lc) != currentCall) {
|
||||
currentCall = linphone_core_get_current_call(lc);
|
||||
[self onCurrentCallChange];
|
||||
}
|
||||
|
||||
// Fake call update
|
||||
if (call == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (state != LinphoneCallPausedByRemote) {
|
||||
_pausedByRemoteView.hidden = YES;
|
||||
}
|
||||
|
||||
switch (state) {
|
||||
case LinphoneCallIncomingReceived:
|
||||
case LinphoneCallOutgoingInit:
|
||||
case LinphoneCallConnected:
|
||||
case LinphoneCallStreamsRunning: {
|
||||
// check video
|
||||
if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
|
||||
[self displayVideoCall:animated];
|
||||
} else {
|
||||
[self displayTableCall:animated];
|
||||
const LinphoneCallParams *param = linphone_call_get_current_params(call);
|
||||
const LinphoneCallAppData *callAppData =
|
||||
(__bridge const LinphoneCallAppData *)(linphone_call_get_user_pointer(call));
|
||||
if (state == LinphoneCallStreamsRunning && callAppData->videoRequested &&
|
||||
linphone_call_params_low_bandwidth_enabled(param)) {
|
||||
// too bad video was not enabled because low bandwidth
|
||||
UIAlertView *alert = [[UIAlertView alloc]
|
||||
initWithTitle:NSLocalizedString(@"Low bandwidth", nil)
|
||||
message:NSLocalizedString(@"Video cannot be activated because of low bandwidth "
|
||||
@"condition, only audio is available",
|
||||
nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
callAppData->videoRequested = FALSE; /*reset field*/
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LinphoneCallUpdatedByRemote: {
|
||||
const LinphoneCallParams *current = linphone_call_get_current_params(call);
|
||||
const LinphoneCallParams *remote = linphone_call_get_remote_params(call);
|
||||
|
||||
/* remote wants to add video */
|
||||
if (linphone_core_video_enabled(lc) && !linphone_call_params_video_enabled(current) &&
|
||||
linphone_call_params_video_enabled(remote) &&
|
||||
!linphone_core_get_video_policy(lc)->automatically_accept) {
|
||||
linphone_core_defer_call_update(lc, call);
|
||||
[self displayAskToEnableVideoCall:call];
|
||||
} else if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) {
|
||||
[self displayTableCall:animated];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LinphoneCallPausing:
|
||||
case LinphoneCallPaused:
|
||||
[self displayTableCall:animated];
|
||||
break;
|
||||
case LinphoneCallPausedByRemote:
|
||||
if (call == linphone_core_get_current_call(lc)) {
|
||||
_pausedByRemoteView.hidden = NO;
|
||||
}
|
||||
break;
|
||||
case LinphoneCallEnd:
|
||||
case LinphoneCallError:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - ActionSheet Functions
|
||||
|
||||
- (void)displayAskToEnableVideoCall:(LinphoneCall *)call {
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
LinphoneAddress *addr = linphone_call_log_get_remote_address(callLog);
|
||||
ABRecordRef contact = [FastAddressBook getContactWithLinphoneAddress:addr];
|
||||
_addContactButton.hidden = (contact != nil);
|
||||
[ContactDisplay setDisplayNameLabel:_contactLabel forContact:contact];
|
||||
[ContactDisplay setDisplayNameLabel:_contactLabel forAddress:addr];
|
||||
_avatarImage.image = [FastAddressBook getContactImage:contact thumbnail:NO];
|
||||
char *addrURI = linphone_address_as_string_uri_only(addr);
|
||||
_addressLabel.text = [NSString stringWithUTF8String:addrURI];
|
||||
|
|
|
|||
|
|
@ -55,12 +55,12 @@
|
|||
<rect key="frame" x="322" y="3" width="45" height="45"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Pause"/>
|
||||
<state key="normal" image="pause_big_default.png">
|
||||
<state key="normal" image="pause_small_default.png">
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="disabled" image="pause_big_disabled.png"/>
|
||||
<state key="selected" image="pause_big_over_selected.png"/>
|
||||
<state key="highlighted" image="pause_big_over_selected.png"/>
|
||||
<state key="disabled" image="pause_small_disabled.png"/>
|
||||
<state key="selected" image="pause_small_over_selected.png"/>
|
||||
<state key="highlighted" image="pause_small_over_selected.png"/>
|
||||
</button>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="tZi-KI-viq" userLabel="durationLabel">
|
||||
<rect key="frame" x="245" y="7" width="69" height="37"/>
|
||||
|
|
@ -87,9 +87,9 @@
|
|||
<resources>
|
||||
<image name="avatar.png" width="255" height="255"/>
|
||||
<image name="color_A.png" width="1" height="1"/>
|
||||
<image name="pause_big_default.png" width="51" height="50"/>
|
||||
<image name="pause_big_disabled.png" width="51" height="50"/>
|
||||
<image name="pause_big_over_selected.png" width="51" height="50"/>
|
||||
<image name="pause_small_default.png" width="34" height="34"/>
|
||||
<image name="pause_small_disabled.png" width="34" height="34"/>
|
||||
<image name="pause_small_over_selected.png" width="34" height="34"/>
|
||||
</resources>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
- (void)setImage:(UIImage *)image withRoundedRadius:(BOOL)rounded {
|
||||
[super setImage:image];
|
||||
if (image.size.width != image.size.height) {
|
||||
LOGI(@"Image is not squared (%dx%d) - cropping it", image.size.width, image.size.height);
|
||||
LOGI(@"Image is not squared (%fx%f) - cropping it", image.size.width, image.size.height);
|
||||
}
|
||||
[self setRoundRadius:rounded];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 49a80e87f3237551bf60f51ef6f67aa384446af8
|
||||
Subproject commit 2d6dc652540660465219334312bbc40d6a2545f4
|
||||
Loading…
Add table
Reference in a new issue