diff --git a/Classes/Base.lproj/CallIncomingView.xib b/Classes/Base.lproj/CallIncomingView.xib index 3e4807f9a..1e1514e96 100644 --- a/Classes/Base.lproj/CallIncomingView.xib +++ b/Classes/Base.lproj/CallIncomingView.xib @@ -1,7 +1,6 @@ - diff --git a/Classes/Base.lproj/CallOutgoingView.xib b/Classes/Base.lproj/CallOutgoingView.xib index c5e0cfc9a..02366226c 100644 --- a/Classes/Base.lproj/CallOutgoingView.xib +++ b/Classes/Base.lproj/CallOutgoingView.xib @@ -1,7 +1,6 @@ - diff --git a/Classes/Base.lproj/CallView.xib b/Classes/Base.lproj/CallView.xib index 56efc699b..b1a673816 100644 --- a/Classes/Base.lproj/CallView.xib +++ b/Classes/Base.lproj/CallView.xib @@ -26,6 +26,7 @@ + @@ -49,7 +50,7 @@ - + @@ -62,11 +63,11 @@ - + - + - + @@ -85,30 +86,18 @@ - - + @@ -167,6 +156,18 @@ + + + + + + + + + + + + - + @@ -409,7 +410,7 @@ - + diff --git a/Classes/Base.lproj/HistoryDetailsView.xib b/Classes/Base.lproj/HistoryDetailsView.xib index 6f52984d9..93c6c79e1 100644 --- a/Classes/Base.lproj/HistoryDetailsView.xib +++ b/Classes/Base.lproj/HistoryDetailsView.xib @@ -1,7 +1,6 @@ - diff --git a/Classes/CallIncomingView.m b/Classes/CallIncomingView.m index ef1856444..5e0bd7de0 100644 --- a/Classes/CallIncomingView.m +++ b/Classes/CallIncomingView.m @@ -102,7 +102,7 @@ static UICompositeViewDescription *compositeDescription = nil; } - (void)update { - [self view]; // Force view load + // [self view]; // Force view load const LinphoneAddress *addr = linphone_call_get_remote_address(call); [ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr]; diff --git a/Classes/PausedCallsTableView.h b/Classes/CallPausedTableView.h similarity index 88% rename from Classes/PausedCallsTableView.h rename to Classes/CallPausedTableView.h index 58a66ea59..7b64bc45e 100644 --- a/Classes/PausedCallsTableView.h +++ b/Classes/CallPausedTableView.h @@ -19,11 +19,7 @@ #import -#import "UICallCell.h" - -#include "linphone/linphonecore.h" - -@interface PausedCallsTableView : UITableViewController { +@interface CallPausedTableView : UITableViewController { @private NSTimer *updateTime; } diff --git a/Classes/CallPausedTableView.m b/Classes/CallPausedTableView.m new file mode 100644 index 000000000..e2b3b15ed --- /dev/null +++ b/Classes/CallPausedTableView.m @@ -0,0 +1,86 @@ +/* InCallTableViewController.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 "CallPausedTableView.h" +#import "UICallPausedCell.h" +#import "UIConferenceHeader.h" +#import "LinphoneManager.h" +#import "Utils.h" + +@implementation CallPausedTableView + +#pragma mark - ViewController Functions + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + updateTime = + [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(update) userInfo:nil repeats:YES]; +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + if (updateTime != nil) { + [updateTime invalidate]; + updateTime = nil; + } +} + +#pragma mark - UI change + +- (void)update { + [self.tableView reloadData]; + + CGRect newOrigin = self.tableView.frame; + newOrigin.size.height = + [self tableView:self.tableView heightForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; + newOrigin.origin.y = self.tableView.frame.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; +} + +#pragma mark - UITableViewDataSource Functions + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + NSString *kCellId = NSStringFromClass(UICallPausedCell.class); + UICallPausedCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; + if (cell == nil) { + cell = [[UICallPausedCell alloc] initWithIdentifier:kCellId]; + } + cell.call = [self pausedCallForRow:indexPath.row]; + return cell; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return ms_list_size(linphone_core_get_calls([LinphoneManager getLc])) /* - 1*/; +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return [self tableView:tableView cellForRowAtIndexPath:indexPath].frame.size.height; +} + +@end diff --git a/Classes/CallView.h b/Classes/CallView.h index 53cc94ca8..62ebb7418 100644 --- a/Classes/CallView.h +++ b/Classes/CallView.h @@ -23,7 +23,7 @@ #import "UICamSwitch.h" #import "UICompositeView.h" -#import "PausedCallsTableView.h" +#import "CallPausedTableView.h" #import "UIMicroButton.h" #import "UIPauseButton.h" @@ -43,7 +43,7 @@ VideoZoomHandler *videoZoomHandler; } -@property(nonatomic, strong) IBOutlet PausedCallsTableView *pausedCallsTableView; +@property(nonatomic, strong) IBOutlet CallPausedTableView *pausedCallsTableView; @property(nonatomic, strong) IBOutlet UIView *videoGroup; @property(nonatomic, strong) IBOutlet UIView *videoView; diff --git a/Classes/CallView.m b/Classes/CallView.m index ad2aaa938..2ff08371d 100644 --- a/Classes/CallView.m +++ b/Classes/CallView.m @@ -25,7 +25,6 @@ #import #import "CallView.h" -#import "UICallCell.h" #import "LinphoneManager.h" #import "PhoneMainView.h" #import "Utils.h" @@ -784,10 +783,8 @@ static void hideSpinner(LinphoneCall *call, void *user_data) { // Go to dialer view DialerView *view = VIEW(DialerView); [PhoneMainView.instance changeCurrentView:view.compositeViewDescription]; - if (view != nil) { - [view setAddress:@""]; - [view setTransferMode:FALSE]; - } + [view setAddress:@""]; + [view setTransferMode:FALSE]; } - (IBAction)onOptionsClick:(id)sender { diff --git a/Classes/LinphoneUI/Base.lproj/UICallCell.xib b/Classes/LinphoneUI/Base.lproj/UICallCell.xib deleted file mode 100644 index 2977e89a3..000000000 --- a/Classes/LinphoneUI/Base.lproj/UICallCell.xib +++ /dev/null @@ -1,465 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Classes/LinphoneUI/UICallCell.h b/Classes/LinphoneUI/UICallCell.h deleted file mode 100644 index a85de276a..000000000 --- a/Classes/LinphoneUI/UICallCell.h +++ /dev/null @@ -1,114 +0,0 @@ -/* UICallCell.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 Library 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 - -#include "linphone/linphonecore.h" -#include "UIPauseButton.h" -#import "UITransparentTVCell.h" - -typedef enum _UICallCellOtherView { - UICallCellOtherView_Avatar = 0, - UICallCellOtherView_AudioStats, - UICallCellOtherView_VideoStats, - UICallCellOtherView_MAX -} UICallCellOtherView; - -@interface UICallCellData : NSObject { - @public - UICallCellOtherView view; - LinphoneCall *call; -} - -- (id)init:(LinphoneCall *)call; - -@property (nonatomic, strong) UIImage *image; -@property (nonatomic, strong) NSString *address; - -@end - -@interface UICallCell : UITransparentTVCell { -} - -@property (nonatomic, strong) UICallCellData *data; - -@property (nonatomic, strong) IBOutlet UIImageView* headerBackgroundImage; -@property (nonatomic, strong) IBOutlet UIImageView* headerBackgroundHighlightImage; - -@property (nonatomic, strong) IBOutlet UILabel* addressLabel; -@property (nonatomic, strong) IBOutlet UILabel* stateLabel; -@property (nonatomic, strong) IBOutlet UIImageView* stateImage; -@property (nonatomic, strong) IBOutlet UIImageView* avatarImage; -@property (nonatomic, strong) IBOutlet UIButton *removeButton; -@property (nonatomic, strong) IBOutlet UIPauseButton *pauseButton; - -@property (nonatomic, strong) IBOutlet UIView* headerView; -@property (nonatomic, strong) IBOutlet UIView* avatarView; - -@property (nonatomic, strong) IBOutlet UIView* audioStatsView; - -@property (nonatomic, strong) IBOutlet UILabel* audioCodecLabel; -@property (nonatomic, strong) IBOutlet UILabel* audioCodecHeaderLabel; -@property (nonatomic, strong) IBOutlet UILabel* audioUploadBandwidthLabel; -@property (nonatomic, strong) IBOutlet UILabel* audioUploadBandwidthHeaderLabel; -@property (nonatomic, strong) IBOutlet UILabel* audioDownloadBandwidthLabel; -@property (nonatomic, strong) IBOutlet UILabel* audioDownloadBandwidthHeaderLabel; -@property (nonatomic, strong) IBOutlet UILabel* audioIceConnectivityLabel; -@property (nonatomic, strong) IBOutlet UILabel* audioIceConnectivityHeaderLabel; - -@property (nonatomic, strong) IBOutlet UIView* videoStatsView; - -@property (nonatomic, strong) IBOutlet UILabel* videoCodecLabel; -@property (nonatomic, strong) IBOutlet UILabel* videoCodecHeaderLabel; - -@property(strong, nonatomic) IBOutlet UILabel *videoSentSizeFPSHeaderLabel; -@property(strong, nonatomic) IBOutlet UILabel *videoSentSizeFPSLabel; -@property(strong, nonatomic) IBOutlet UILabel *videoRecvSizeFPSHeaderLabel; -@property(strong, nonatomic) IBOutlet UILabel *videoRecvSizeFPSLabel; - -@property (nonatomic, strong) IBOutlet UILabel* videoUploadBandwidthLabel; -@property (nonatomic, strong) IBOutlet UILabel* videoUploadBandwidthHeaderLabel; -@property (nonatomic, strong) IBOutlet UILabel* videoDownloadBandwidthLabel; -@property (nonatomic, strong) IBOutlet UILabel* videoDownloadBandwidthHeaderLabel; -@property (nonatomic, strong) IBOutlet UILabel* videoIceConnectivityLabel; -@property (nonatomic, strong) IBOutlet UILabel* videoIceConnectivityHeaderLabel; - -@property (nonatomic, strong) IBOutlet UIView* otherView; - -@property (nonatomic, strong) IBOutlet UISwipeGestureRecognizer *detailsLeftSwipeGestureRecognizer; -@property (nonatomic, strong) IBOutlet UISwipeGestureRecognizer *detailsRightSwipeGestureRecognizer; - -@property (assign) BOOL firstCell; -@property (assign) BOOL conferenceCell; -@property (nonatomic, assign) BOOL currentCall; -@property (strong, nonatomic) IBOutlet UILabel *outgoingRingCountLabel; -@property (strong) NSTimer *outgoingRingCountTimer; - - -- (void)update; - -- (id)initWithIdentifier:(NSString*)identifier; - -- (IBAction)doHeaderClick:(id)sender; -- (IBAction)doRemoveClick:(id)sender; -- (IBAction)doDetailsSwipe:(UISwipeGestureRecognizer *)sender; - -+ (int)getMaximizedHeight; - -@end diff --git a/Classes/LinphoneUI/UICallCell.m b/Classes/LinphoneUI/UICallCell.m deleted file mode 100644 index f33febf8a..000000000 --- a/Classes/LinphoneUI/UICallCell.m +++ /dev/null @@ -1,518 +0,0 @@ -/* UICallCell.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 Library 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 - -#import "UICallCell.h" -#import "LinphoneManager.h" -#import "FastAddressBook.h" -#import "Utils.h" -#import "PhoneMainView.h" -#import "PausedCallsTableView.h" - -@implementation UICallCellData - -@synthesize address; -@synthesize image; - -- (id)init:(LinphoneCall *)acall { - self = [super init]; - if (self != nil) { - view = UICallCellOtherView_Avatar; - call = acall; - image = [UIImage imageNamed:@"avatar_unknown.png"]; - address = NSLocalizedString(@"Unknown", nil); - [self update]; - } - return self; -} - -- (void)update { - if (call == NULL) { - LOGW(@"Cannot update call cell: null call or data"); - return; - } - const LinphoneAddress *addr = linphone_call_get_remote_address(call); - address = [FastAddressBook displayNameForAddress:addr]; - - ABRecordRef contact = [FastAddressBook getContactWithLinphoneAddress:addr]; - UIImage *tmpImage = [FastAddressBook getContactImage:contact thumbnail:false]; - if (tmpImage != nil) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL), ^(void) { - UIImage *tmpImage2 = [UIImage decodedImageWithImage:tmpImage]; - dispatch_async(dispatch_get_main_queue(), ^{ - [self setImage:tmpImage2]; - }); - }); - } -} - -@end - -@implementation UICallCell - -@synthesize data; - -@synthesize headerBackgroundImage; -@synthesize headerBackgroundHighlightImage; - -@synthesize addressLabel; -@synthesize stateLabel; -@synthesize stateImage; -@synthesize avatarImage; -@synthesize pauseButton; -@synthesize removeButton; - -@synthesize headerView; -@synthesize avatarView; - -@synthesize audioStatsView; - -@synthesize audioCodecLabel; -@synthesize audioCodecHeaderLabel; -@synthesize audioUploadBandwidthLabel; -@synthesize audioUploadBandwidthHeaderLabel; -@synthesize audioDownloadBandwidthLabel; -@synthesize audioDownloadBandwidthHeaderLabel; -@synthesize audioIceConnectivityLabel; -@synthesize audioIceConnectivityHeaderLabel; - -@synthesize videoStatsView; - -@synthesize videoCodecLabel, videoCodecHeaderLabel; -@synthesize videoUploadBandwidthLabel, videoUploadBandwidthHeaderLabel; -@synthesize videoDownloadBandwidthLabel, videoDownloadBandwidthHeaderLabel; -@synthesize videoIceConnectivityLabel, videoIceConnectivityHeaderLabel; - -@synthesize videoRecvSizeFPSHeaderLabel, videoRecvSizeFPSLabel; -@synthesize videoSentSizeFPSHeaderLabel, videoSentSizeFPSLabel; - -@synthesize otherView; - -@synthesize firstCell; -@synthesize conferenceCell; -@synthesize currentCall; -@synthesize detailsLeftSwipeGestureRecognizer; -@synthesize detailsRightSwipeGestureRecognizer; - -#pragma mark - Lifecycle Functions - -- (id)initWithIdentifier:(NSString *)identifier { - if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) { - NSArray *arrayOfViews = - [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self.class) owner:self options:nil]; - - if ([arrayOfViews count] >= 1) { - // resize cell to match .nib size. It is needed when resized the cell to - // correctly adapt its height too - UIView *sub = ((UIView *)[arrayOfViews objectAtIndex:0]); - [self setFrame:CGRectMake(0, 0, sub.frame.size.width, sub.frame.size.height)]; - [self addSubview:sub]; - } - - currentCall = FALSE; - - _outgoingRingCountLabel.hidden = YES; - _outgoingRingCountLabel.text = @"0"; - - detailsRightSwipeGestureRecognizer = - [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(doDetailsSwipe:)]; - [detailsRightSwipeGestureRecognizer setDirection:UISwipeGestureRecognizerDirectionLeft]; - [otherView addGestureRecognizer:detailsRightSwipeGestureRecognizer]; - - detailsRightSwipeGestureRecognizer = - [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(doDetailsSwipe:)]; - [detailsRightSwipeGestureRecognizer setDirection:UISwipeGestureRecognizerDirectionRight]; - [otherView addGestureRecognizer:detailsRightSwipeGestureRecognizer]; - - [avatarView setHidden:TRUE]; - [audioStatsView setHidden:TRUE]; - [videoStatsView setHidden:TRUE]; - - [UICallCell adaptSize:audioCodecHeaderLabel field:audioCodecLabel]; - [UICallCell adaptSize:audioDownloadBandwidthHeaderLabel field:audioDownloadBandwidthLabel]; - [UICallCell adaptSize:audioUploadBandwidthHeaderLabel field:audioUploadBandwidthLabel]; - [UICallCell adaptSize:audioIceConnectivityHeaderLabel field:audioIceConnectivityLabel]; - - [UICallCell adaptSize:videoCodecHeaderLabel field:videoCodecLabel]; - [UICallCell adaptSize:videoDownloadBandwidthHeaderLabel field:videoDownloadBandwidthLabel]; - [UICallCell adaptSize:videoUploadBandwidthHeaderLabel field:videoUploadBandwidthLabel]; - [UICallCell adaptSize:videoIceConnectivityHeaderLabel field:videoIceConnectivityLabel]; - - if (LinphoneManager.runningOnIpad) { - [LinphoneUtils adjustFontSize:self.audioStatsView mult:2.22]; - [LinphoneUtils adjustFontSize:self.videoStatsView mult:2.22]; - } - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(applicationWillEnterForeground:) - name:UIApplicationWillEnterForegroundNotification - object:nil]; - } - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self - name:UIApplicationWillEnterForegroundNotification - object:nil]; -} - -#pragma mark - Properties Functions - -- (void)setData:(UICallCellData *)adata { - if (adata == data) { - return; - } - if (data != nil) { - data = nil; - } - if (adata != nil) { - data = adata; - } -} - -- (void)setCurrentCall:(BOOL)val { - currentCall = val; - if (currentCall && ![self isBlinkAnimationRunning:@"blink" target:headerBackgroundHighlightImage]) { - [self startBlinkAnimation:@"blink" target:headerBackgroundHighlightImage]; - } - if (!currentCall) { - [self stopBlinkAnimation:@"blink" target:headerBackgroundHighlightImage]; - } -} - -#pragma mark - Static Functions - -+ (int)getMaximizedHeight { - return LinphoneManager.runningOnIpad ? 126 : 63; -} - -+ (void)adaptSize:(UILabel *)label field:(UIView *)field { - // - // Adapt size - // - CGRect labelFrame = [label frame]; - CGRect fieldFrame = [field frame]; - - fieldFrame.origin.x -= labelFrame.size.width; - - // Compute firstName size - CGSize contraints; - contraints.height = [label frame].size.height; - contraints.width = ([field frame].size.width + [field frame].origin.x) - [label frame].origin.x; - CGSize firstNameSize = [[label text] sizeWithFont:[label font] constrainedToSize:contraints]; - labelFrame.size.width = firstNameSize.width; - - // Compute lastName size & position - fieldFrame.origin.x += labelFrame.size.width; - fieldFrame.size.width = (contraints.width + [label frame].origin.x) - fieldFrame.origin.x; - - [label setFrame:labelFrame]; - [field setFrame:fieldFrame]; -} - -+ (NSString *)iceToString:(LinphoneIceState)state { - switch (state) { - case LinphoneIceStateNotActivated: - return NSLocalizedString(@"Not activated", @"ICE has not been activated for this call"); - break; - case LinphoneIceStateFailed: - return NSLocalizedString(@"Failed", @"ICE processing has failed"); - break; - case LinphoneIceStateInProgress: - return NSLocalizedString(@"In progress", @"ICE process is in progress"); - break; - case LinphoneIceStateHostConnection: - return NSLocalizedString(@"Direct connection", @"ICE has established a direct connection to the remote host"); - break; - case LinphoneIceStateReflexiveConnection: - return NSLocalizedString(@"NAT(s) connection", - @"ICE has established a connection to the remote host through one or several NATs"); - break; - case LinphoneIceStateRelayConnection: - return NSLocalizedString(@"Relay connection", @"ICE has established a connection through a relay"); - break; - } -} - -#pragma mark - Event Functions - -- (void)applicationWillEnterForeground:(NSNotification *)notif { - if (currentCall) { - [self startBlinkAnimation:@"blink" target:headerBackgroundHighlightImage]; - } -} - -#pragma mark - Animation Functions - -- (void)startBlinkAnimation:(NSString *)animationID target:(UIView *)target { - if ([[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"]) { - CABasicAnimation *blink = [CABasicAnimation animationWithKeyPath:@"opacity"]; - blink.duration = 1.0; - blink.fromValue = [NSNumber numberWithDouble:0.0f]; - blink.toValue = [NSNumber numberWithDouble:1.0f]; - blink.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; - blink.autoreverses = TRUE; - blink.repeatCount = HUGE_VALF; - [target.layer addAnimation:blink forKey:animationID]; - } else { - [target setAlpha:1.0f]; - } -} - -- (BOOL)isBlinkAnimationRunning:(NSString *)animationID target:(UIView *)target { - return [target.layer animationForKey:animationID] != nil; -} - -- (void)stopBlinkAnimation:(NSString *)animationID target:(UIView *)target { - if ([self isBlinkAnimationRunning:animationID target:target]) { - [target.layer removeAnimationForKey:animationID]; - } - [target setAlpha:0.0f]; -} - -- (void)displayIncrementedOutgoingRingCount { - _outgoingRingCountLabel.hidden = NO; - [UIView transitionWithView:_outgoingRingCountLabel - duration:0.5f - options:UIViewAnimationOptionTransitionCrossDissolve - animations:^{ - _outgoingRingCountLabel.text = [@(_outgoingRingCountLabel.text.intValue + 1) stringValue]; - } - completion:nil]; -} - -- (void)stopOutgoingRingCount { - if (_outgoingRingCountTimer != nil) - [_outgoingRingCountTimer invalidate]; - _outgoingRingCountLabel.hidden = YES; - _outgoingRingCountLabel.text = @"0"; - _outgoingRingCountTimer = nil; -} - -#pragma mark - - -- (void)update { - if (data == nil || data->call == NULL) { - LOGW(@"Cannot update call cell: null call or data"); - return; - } - LinphoneCall *call = data->call; - - [pauseButton setType:UIPauseButtonType_Call call:call]; - - [addressLabel setText:data.address]; - [avatarImage setImage:data.image]; - - LinphoneCallState state = linphone_call_get_state(call); - if (!conferenceCell) { - if (state == LinphoneCallOutgoingRinging) { - [stateImage setImage:[UIImage imageNamed:@"call_state_ringing_default.png"]]; - [stateImage setHidden:false]; - [pauseButton setHidden:true]; - if (_outgoingRingCountTimer == nil) { - _outgoingRingCountTimer = - [NSTimer scheduledTimerWithTimeInterval:2.0f - target:self - selector:@selector(displayIncrementedOutgoingRingCount) - userInfo:nil - repeats:YES]; - [_outgoingRingCountTimer fire]; - } - } else if (state == LinphoneCallOutgoingInit || state == LinphoneCallOutgoingProgress) { - [stateImage setImage:[UIImage imageNamed:@"call_state_outgoing_default.png"]]; - [stateImage setHidden:false]; - [pauseButton setHidden:true]; - [self stopOutgoingRingCount]; - } else { - [stateImage setHidden:true]; - [pauseButton setHidden:false]; - [pauseButton update]; - [self stopOutgoingRingCount]; - } - [removeButton setHidden:true]; - if (firstCell) { - [headerBackgroundImage setImage:[UIImage imageNamed:@"cell_call_first.png"]]; - [headerBackgroundHighlightImage setImage:[UIImage imageNamed:@"cell_call_first_highlight.png"]]; - } else { - [headerBackgroundImage setImage:[UIImage imageNamed:@"cell_call.png"]]; - [headerBackgroundHighlightImage setImage:[UIImage imageNamed:@"cell_call_highlight.png"]]; - } - } else { - [stateImage setHidden:true]; - [pauseButton setHidden:true]; - [removeButton setHidden:false]; - [headerBackgroundImage setImage:[UIImage imageNamed:@"cell_conference.png"]]; - } - - int duration = linphone_call_get_duration(call); - [stateLabel setText:[NSString stringWithFormat:@"%02i:%02i", (duration / 60), (duration % 60), nil]]; - - CGRect frame = [self frame]; - frame.size.height = [UICallCell getMaximizedHeight]; - [self setFrame:frame]; - frame = otherView.frame; - frame.size.height = [UICallCell getMaximizedHeight]; - [otherView setHidden:false]; - otherView.frame = frame; - - [self updateStats]; - - [self updateDetailsView]; -} - -- (void)updateStats { - if (data == nil || data->call == NULL) { - LOGW(@"Cannot update call cell: null call or data"); - return; - } - LinphoneCall *call = data->call; - - const LinphoneCallParams *params = linphone_call_get_current_params(call); - { - const PayloadType *payload = linphone_call_params_get_used_audio_codec(params); - if (payload != NULL) { - [audioCodecLabel setText:[NSString stringWithFormat:@"%s/%i/%i", payload->mime_type, payload->clock_rate, - payload->channels]]; - } else { - [audioCodecLabel setText:NSLocalizedString(@"No codec", nil)]; - } - const LinphoneCallStats *stats = linphone_call_get_audio_stats(call); - if (stats != NULL) { - [audioUploadBandwidthLabel setText:[NSString stringWithFormat:@"%1.1f kbits/s", stats->upload_bandwidth]]; - [audioDownloadBandwidthLabel - setText:[NSString stringWithFormat:@"%1.1f kbits/s", stats->download_bandwidth]]; - [audioIceConnectivityLabel setText:[UICallCell iceToString:stats->ice_state]]; - } else { - [audioUploadBandwidthLabel setText:@""]; - [audioDownloadBandwidthLabel setText:@""]; - [audioIceConnectivityLabel setText:@""]; - } - } - - { - const PayloadType *payload = linphone_call_params_get_used_video_codec(params); - if (payload != NULL) { - [videoCodecLabel setText:[NSString stringWithFormat:@"%s/%i", payload->mime_type, payload->clock_rate]]; - } else { - [videoCodecLabel setText:NSLocalizedString(@"No codec", nil)]; - } - - const LinphoneCallStats *stats = linphone_call_get_video_stats(call); - - if (stats != NULL && linphone_call_params_video_enabled(params)) { - MSVideoSize sentSize = linphone_call_params_get_sent_video_size(params); - MSVideoSize recvSize = linphone_call_params_get_received_video_size(params); - float sentFPS = linphone_call_params_get_sent_framerate(params); - float recvFPS = linphone_call_params_get_received_framerate(params); - - [videoUploadBandwidthLabel setText:[NSString stringWithFormat:@"%1.1f kbits/s", stats->upload_bandwidth]]; - [videoDownloadBandwidthLabel - setText:[NSString stringWithFormat:@"%1.1f kbits/s", stats->download_bandwidth]]; - [videoIceConnectivityLabel setText:[UICallCell iceToString:stats->ice_state]]; - [videoSentSizeFPSLabel - setText:[NSString stringWithFormat:@"%dx%d (%.1fFPS)", sentSize.width, sentSize.height, sentFPS]]; - [videoRecvSizeFPSLabel - setText:[NSString stringWithFormat:@"%dx%d (%.1fFPS)", recvSize.width, recvSize.height, recvFPS]]; - } else { - [videoUploadBandwidthLabel setText:@""]; - [videoDownloadBandwidthLabel setText:@""]; - [videoIceConnectivityLabel setText:@""]; - [videoSentSizeFPSLabel setText:@"0x0"]; - [videoRecvSizeFPSLabel setText:@"0x0"]; - } - } -} - -- (void)updateDetailsView { - if (data == nil || data->call == NULL) { - LOGW(@"Cannot update call cell: null call or data"); - return; - } - if (data->view == UICallCellOtherView_Avatar && avatarView.isHidden) { - [avatarView setHidden:FALSE]; - [audioStatsView setHidden:TRUE]; - [videoStatsView setHidden:TRUE]; - } else if (data->view == UICallCellOtherView_AudioStats && audioStatsView.isHidden) { - [avatarView setHidden:TRUE]; - [audioStatsView setHidden:FALSE]; - [videoStatsView setHidden:TRUE]; - } else if (data->view == UICallCellOtherView_VideoStats && videoStatsView.isHidden) { - [avatarView setHidden:TRUE]; - [audioStatsView setHidden:TRUE]; - [videoStatsView setHidden:FALSE]; - } -} - -- (void)selfUpdate { - UITableView *tableView = VIEW(CallView).pausedCallsTableView.tableView; - NSIndexPath *index = [tableView indexPathForCell:self]; - [tableView reloadRowsAtIndexPaths:@[ index ] withRowAnimation:false]; -} - -#pragma mark - Action Functions - -- (IBAction)doHeaderClick:(id)sender { - if (data) { - [self selfUpdate]; - } -} - -- (IBAction)doRemoveClick:(id)sender { - if (data != nil && data->call != NULL) { - linphone_core_remove_from_conference([LinphoneManager getLc], data->call); - } -} - -- (IBAction)doDetailsSwipe:(UISwipeGestureRecognizer *)sender { - CATransition *trans = nil; - if (data != nil) { - if (sender.direction == UISwipeGestureRecognizerDirectionLeft) { - if (data->view == UICallCellOtherView_MAX - 1) { - data->view = 0; - } else { - ++data->view; - } - trans = [CATransition animation]; - [trans setType:kCATransitionPush]; - [trans setDuration:0.35]; - [trans setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; - [trans setSubtype:kCATransitionFromRight]; - } else if (sender.direction == UISwipeGestureRecognizerDirectionRight) { - if (data->view == 0) { - data->view = UICallCellOtherView_MAX - 1; - } else { - --data->view; - } - trans = [CATransition animation]; - [trans setType:kCATransitionPush]; - [trans setDuration:0.35]; - [trans setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; - [trans setSubtype:kCATransitionFromLeft]; - } - if (trans) { - [otherView.layer removeAnimationForKey:@"transition"]; - [otherView.layer addAnimation:trans forKey:@"transition"]; - [self updateDetailsView]; - } - } -} - -@end diff --git a/Classes/LinphoneUI/UICallPausedCell.h b/Classes/LinphoneUI/UICallPausedCell.h new file mode 100644 index 000000000..9ed7620e8 --- /dev/null +++ b/Classes/LinphoneUI/UICallPausedCell.h @@ -0,0 +1,23 @@ +// +// UIPausedCallCell.h +// linphone +// +// Created by Gautier Pelloux-Prayer on 11/09/15. +// +// + +#import "UITransparentTVCell.h" + +#import "UIRoundedImageView.h" +#import "LinphoneManager.h" + +@interface UICallPausedCell : UITransparentTVCell + +@property(weak, nonatomic) IBOutlet UIRoundedImageView *avatarImage; +@property(weak, nonatomic) IBOutlet UILabel *nameLabel; +@property(weak, nonatomic) IBOutlet UILabel *durationLabel; + +- (id)initWithIdentifier:(NSString *)identifier; +- (void)setCall:(LinphoneCall *)call; + +@end diff --git a/Classes/LinphoneUI/UICallPausedCell.m b/Classes/LinphoneUI/UICallPausedCell.m new file mode 100644 index 000000000..235cd9217 --- /dev/null +++ b/Classes/LinphoneUI/UICallPausedCell.m @@ -0,0 +1,45 @@ +// +// UIPausedCallCell.m +// linphone +// +// Created by Gautier Pelloux-Prayer on 11/09/15. +// +// + +#import "UICallPausedCell.h" +#import "Utils.h" + +@implementation UICallPausedCell + +- (id)initWithIdentifier:(NSString *)identifier { + self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; + if (self != nil) { + NSArray *arrayOfViews = + [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self.class) owner:self options:nil]; + if ([arrayOfViews count] >= 1) { + // resize cell to match .nib size. It is needed when resized the cell to + // correctly adapt its height too + UIView *sub = ((UIView *)[arrayOfViews objectAtIndex:0]); + [self setFrame:CGRectMake(0, 0, sub.frame.size.width, sub.frame.size.height)]; + [self addSubview:sub]; + } + } + return self; +} + +- (void)setCall:(LinphoneCall *)call { + if (!call) { + LOGW(@"Cannot update call cell: null call or data"); + return; + } + + const LinphoneAddress *addr = linphone_call_get_remote_address(call); + [ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr]; + _avatarImage.image = + [FastAddressBook getContactImage:[FastAddressBook getContactWithLinphoneAddress:addr] thumbnail:NO]; + + int duration = linphone_call_get_duration(call); + [_durationLabel setText:[NSString stringWithFormat:@"%02i:%02i", (duration / 60), (duration % 60), nil]]; +} + +@end diff --git a/Classes/LinphoneUI/UICallPausedCell.xib b/Classes/LinphoneUI/UICallPausedCell.xib new file mode 100644 index 000000000..cbefe2e58 --- /dev/null +++ b/Classes/LinphoneUI/UICallPausedCell.xib @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Classes/LinphoneUI/UIChatBubbleTextCell.m b/Classes/LinphoneUI/UIChatBubbleTextCell.m index bc07ade9e..8e5dd5516 100644 --- a/Classes/LinphoneUI/UIChatBubbleTextCell.m +++ b/Classes/LinphoneUI/UIChatBubbleTextCell.m @@ -110,6 +110,8 @@ LinphoneChatMessageState state = linphone_chat_message_get_state(message); BOOL outgoing = linphone_chat_message_is_outgoing(message); + _backgroundColor.image = _bottomBarColor.image = [UIImage imageNamed:outgoing ? @"color_A" : @"color_F"]; + if (!outgoing) { _statusImage.accessibilityValue = @"incoming"; _statusImage.hidden = TRUE; // not useful for incoming chats.. @@ -159,11 +161,11 @@ - (void)layoutSubviews { [super layoutSubviews]; if (message != nil) { - // BOOL is_outgoing = linphone_chat_message_is_outgoing(message); + BOOL is_outgoing = linphone_chat_message_is_outgoing(message); CGRect newFrame; newFrame.size = [ChatConversationTableView viewSize:message width:self.frame.size.width]; newFrame.origin.y = 0.0f; - // newFrame.origin.x = is_outgoing ? self.contentView.frame.size.width - newFrame.size.width : 0; + newFrame.origin.x = is_outgoing ? self.contentView.frame.size.width - newFrame.size.width : 0; self.contentView.frame = self.frame = newFrame; } } diff --git a/Classes/LinphoneUI/ar.lproj/UICallCell.strings b/Classes/LinphoneUI/ar.lproj/UICallCell.strings deleted file mode 100644 index a5eb47831..000000000 Binary files a/Classes/LinphoneUI/ar.lproj/UICallCell.strings and /dev/null differ diff --git a/Classes/LinphoneUI/fr.lproj/UICallCell.strings b/Classes/LinphoneUI/fr.lproj/UICallCell.strings deleted file mode 100644 index 477fc2fd7..000000000 Binary files a/Classes/LinphoneUI/fr.lproj/UICallCell.strings and /dev/null differ diff --git a/Classes/LinphoneUI/ru.lproj/UICallCell.strings b/Classes/LinphoneUI/ru.lproj/UICallCell.strings deleted file mode 100644 index c615374a4..000000000 Binary files a/Classes/LinphoneUI/ru.lproj/UICallCell.strings and /dev/null differ diff --git a/Classes/PausedCallsTableView.m b/Classes/PausedCallsTableView.m deleted file mode 100644 index 15b9eeb68..000000000 --- a/Classes/PausedCallsTableView.m +++ /dev/null @@ -1,252 +0,0 @@ -/* InCallTableViewController.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 "PausedCallsTableView.h" -#import "UICallCell.h" -#import "UIConferenceHeader.h" -#import "LinphoneManager.h" -#import "Utils.h" - -@implementation PausedCallsTableView - -static NSString *const kLinphoneInCallCellData = @"LinphoneInCallCellData"; - -enum TableSection { ConferenceSection = 0, CallSection = 1 }; - -#pragma mark - ViewController Functions - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - updateTime = - [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(update) userInfo:nil repeats:YES]; -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - if (updateTime != nil) { - [updateTime invalidate]; - updateTime = nil; - } -} - -#pragma mark - Static Functions - -+ (bool)isInConference:(LinphoneCall *)call { - if (!call) - return false; - return linphone_call_is_in_conference(call); -} - -+ (int)callCount:(LinphoneCore *)lc { - int count = 0; - const MSList *calls = linphone_core_get_calls(lc); - - while (calls != 0) { - if (![PausedCallsTableView isInConference:((LinphoneCall *)calls->data)]) { - count++; - } - calls = calls->next; - } - return count; -} - -+ (LinphoneCall *)retrieveCallAtIndex:(NSInteger)index inConference:(bool)conf { - const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]); - - while (calls != 0) { - if ([PausedCallsTableView isInConference:(LinphoneCall *)calls->data] == conf) { - if (index == 0) - break; - index--; - } - calls = calls->next; - } - - if (calls == 0) { - LOGE(@"Cannot find call with index %d (in conf: %d)", index, conf); - return nil; - } else { - return (LinphoneCall *)calls->data; - } -} - -#pragma mark - - -- (void)removeCallData:(LinphoneCall *)call { - // Remove data associated with the call - if (call != NULL) { - LinphoneCallAppData *appData = (__bridge LinphoneCallAppData *)linphone_call_get_user_pointer(call); - if (appData != NULL) { - [appData->userInfos removeObjectForKey:kLinphoneInCallCellData]; - } - } -} - -- (UICallCellData *)addCallData:(LinphoneCall *)call { - // Handle data associated with the call - UICallCellData *data = nil; - if (call != NULL) { - LinphoneCallAppData *appData = (__bridge LinphoneCallAppData *)linphone_call_get_user_pointer(call); - if (appData != NULL) { - data = [appData->userInfos objectForKey:kLinphoneInCallCellData]; - if (data == nil) { - data = [[UICallCellData alloc] init:call]; - [appData->userInfos setObject:data forKey:kLinphoneInCallCellData]; - } - } - } - return data; -} - -- (UICallCellData *)getCallData:(LinphoneCall *)call { - // Handle data associated with the call - UICallCellData *data = nil; - if (call != NULL) { - LinphoneCallAppData *appData = (__bridge LinphoneCallAppData *)linphone_call_get_user_pointer(call); - if (appData != NULL) { - data = [appData->userInfos objectForKey:kLinphoneInCallCellData]; - } - } - return data; -} - -- (void)update { - UITableView *tableView = [self tableView]; - for (int section = 0; section < [tableView numberOfSections]; section++) { - for (int row = 0; row < [tableView numberOfRowsInSection:section]; row++) { - NSIndexPath *cellPath = [NSIndexPath indexPathForRow:row inSection:section]; - UICallCell *cell = (UICallCell *)[tableView cellForRowAtIndexPath:cellPath]; - [cell update]; - } - } -} -#pragma mark - UITableViewDataSource Functions - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - static NSString *kCellId = @"UICallCell"; - UICallCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; - if (cell == nil) { - cell = [[UICallCell alloc] initWithIdentifier:kCellId]; - } - - bool inConference = indexPath.section == ConferenceSection; - - LinphoneCore *lc = [LinphoneManager getLc]; - LinphoneCall *currentCall = linphone_core_get_current_call(lc); - LinphoneCall *call = [PausedCallsTableView retrieveCallAtIndex:indexPath.row inConference:inConference]; - [cell setData:[self addCallData:call]]; - - // Update cell - if ([indexPath section] == CallSection && [indexPath row] == 0 && linphone_core_get_conference_size(lc) == 0) { - [cell setFirstCell:true]; - } else { - [cell setFirstCell:false]; - } - [cell setCurrentCall:(currentCall == call)]; - [cell setConferenceCell:inConference]; - [cell update]; - - /*if (linphone_core_get_calls_nb(lc) > 1 || linphone_core_get_conference_size(lc) > 0) { - tableView.scrollEnabled = true; - } else { - tableView.scrollEnabled = false; - }*/ - return cell; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - int count = 0; - - LinphoneCore *lc = [LinphoneManager getLc]; - - if (section == CallSection) { - count = [PausedCallsTableView callCount:lc]; - } else { - count = linphone_core_get_conference_size(lc); - if (linphone_core_is_in_conference(lc)) { - count--; - } - } - return count; -} - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 2; -} - -- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - return @""; -} - -- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { - return @""; -} - -#pragma mark - UITableViewDelegate Functions - -- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - if (section == CallSection) { - return [[UIView alloc] initWithFrame:CGRectZero]; - } else if (section == ConferenceSection) { - LinphoneCore *lc = [LinphoneManager getLc]; - if (linphone_core_get_conference_size(lc) > 0) { - UIConferenceHeader *headerController = [[UIConferenceHeader alloc] init]; - [headerController update]; - UIView *headerView = [headerController view]; - return headerView; - } else { - return [[UIView alloc] initWithFrame:CGRectZero]; - } - } - return [[UIView alloc] initWithFrame:CGRectZero]; -} - -- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { - return [[UIView alloc] initWithFrame:CGRectZero]; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - LinphoneCore *lc = [LinphoneManager getLc]; - if (section == CallSection) { - return 0.000001f; // Hack UITableView = 0 - } else if (section == ConferenceSection) { - if (linphone_core_get_conference_size(lc) > 0) { - return [UIConferenceHeader getHeight]; - } - } - return 0.000001f; // Hack UITableView = 0 -} - -- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - LinphoneCore *lc = [LinphoneManager getLc]; - if (section == CallSection) { - return 0.000001f; // Hack UITableView = 0 - } else if (section == ConferenceSection) { - if (linphone_core_get_conference_size(lc) > 0) { - return 20; - } - } - return 0.000001f; // Hack UITableView = 0 -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - return [UICallCell getMaximizedHeight]; -} - -@end diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 04619158a..d6834564f 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -307,8 +307,6 @@ static RootViewManager *rootViewManagerInstance = nil; LinphoneCallState state = [[notif.userInfo objectForKey:@"state"] intValue]; NSString *message = [notif.userInfo objectForKey:@"message"]; - bool canHideInCallView = (linphone_core_get_calls([LinphoneManager getLc]) == NULL); - // Don't handle call state during incoming call view if ([[self currentView] equal:CallIncomingView.compositeViewDescription] && state != LinphoneCallError && state != LinphoneCallEnd) { @@ -344,13 +342,15 @@ static RootViewManager *rootViewManagerInstance = nil; [self displayCallError:call message:message]; } case LinphoneCallEnd: { - if (canHideInCallView) { + const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]); + if (calls == NULL) { // Go to dialer view DialerView *view = VIEW(DialerView); [self changeCurrentView:view.compositeViewDescription]; [view setAddress:@""]; [view setTransferMode:FALSE]; } else { + linphone_core_resume_call([LinphoneManager getLc], (LinphoneCall *)calls->data); [self changeCurrentView:CallView.compositeViewDescription]; } break; diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 7d8eb1783..ebb571f42 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -280,6 +280,8 @@ 63B81A0F1B57DA33009604A6 /* TPKeyboardAvoidingTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B81A091B57DA33009604A6 /* TPKeyboardAvoidingTableView.m */; }; 63B81A101B57DA33009604A6 /* UIScrollView+TPKeyboardAvoidingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B81A0B1B57DA33009604A6 /* UIScrollView+TPKeyboardAvoidingAdditions.m */; }; 63BC49D41BA1AA6F004EC273 /* UIChatBubbleTextCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 63BC49D31BA1AA6F004EC273 /* UIChatBubbleTextCell.xib */; }; + 63BC49E21BA2CDFC004EC273 /* UICallPausedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 63BC49E11BA2CDFC004EC273 /* UICallPausedCell.m */; }; + 63BC49EA1BA2CEDF004EC273 /* UICallPausedCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 63BC49E91BA2CEDF004EC273 /* UICallPausedCell.xib */; }; 63CD4B4F1A5AAC8C00B84282 /* DTAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63CD4B4E1A5AAC8C00B84282 /* DTAlertView.m */; }; 63CFEDE81B9EDD74007EA5BD /* libantlr3c.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 223CA7E416D9255800EF1BEC /* libantlr3c.a */; }; 63CFEDE91B9EDD74007EA5BD /* libavcodec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22276E8013C73D3100210156 /* libavcodec.a */; }; @@ -322,7 +324,7 @@ 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 /* PausedCallsTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D31AAF5D159B3919002C6B02 /* PausedCallsTableView.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 */; }; D3211BB0159C4EF10098460B /* UIConferenceHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = D3211BAE159C4EF00098460B /* UIConferenceHeader.m */; }; @@ -340,7 +342,6 @@ D35860D615B549B500513429 /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = D35860D515B549B500513429 /* Utils.m */; }; D35E7597159460580066B1C1 /* ChatsListView.m in Sources */ = {isa = PBXBuildFile; fileRef = D35E7595159460560066B1C1 /* ChatsListView.m */; }; D35E759F159460B70066B1C1 /* SettingsView.m in Sources */ = {isa = PBXBuildFile; fileRef = D35E759D159460B50066B1C1 /* SettingsView.m */; }; - D36C43C6158F2E5A0048BA40 /* UICallCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D36C43C5158F2E5A0048BA40 /* UICallCell.m */; }; D36FB2D51589EF7C0036F6F2 /* UIPauseButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */; }; D378906515AC373B00BD776C /* ContactDetailsLabelView.m in Sources */ = {isa = PBXBuildFile; fileRef = D378906315AC373B00BD776C /* ContactDetailsLabelView.m */; }; D378AB2A15DCDB4A0098505D /* ImagePickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = D378AB2915DCDB490098505D /* ImagePickerView.m */; }; @@ -381,7 +382,6 @@ D38187DD15FE348A00C3EDCA /* AssistantView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D38187E015FE348A00C3EDCA /* AssistantView.xib */; }; D38187F015FE354000C3EDCA /* UIConferenceHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = D38187F315FE354000C3EDCA /* UIConferenceHeader.xib */; }; D38187F815FE355D00C3EDCA /* TabBarView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D38187FB15FE355D00C3EDCA /* TabBarView.xib */; }; - D381881115FE3F0B00C3EDCA /* UICallCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D381881415FE3F0B00C3EDCA /* UICallCell.xib */; }; D381881915FE3FCA00C3EDCA /* CallView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D381881C15FE3FCA00C3EDCA /* CallView.xib */; }; D3A55FBC15877E5E003FD403 /* UIContactCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3A55FBB15877E5E003FD403 /* UIContactCell.m */; }; D3A8BB7015A6C7D500F96BE5 /* UIChatBubbleTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3A8BB6F15A6C7D500F96BE5 /* UIChatBubbleTextCell.m */; }; @@ -851,8 +851,6 @@ 639CEB011A1DF4E4004DE38F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UIHistoryCell.xib; sourceTree = ""; }; 639CEB041A1DF4EB004DE38F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UICompositeView.xib; sourceTree = ""; }; 639CEB0A1A1DF4FA004DE38F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UIChatCell.xib; sourceTree = ""; }; - 639CEB0C1A1DF528004DE38F /* fr */ = {isa = PBXFileReference; fileEncoding = 2483028224; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/UICallCell.strings; sourceTree = ""; }; - 639CEB0D1A1DF52C004DE38F /* ru */ = {isa = PBXFileReference; fileEncoding = 2483028224; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/UICallCell.strings; sourceTree = ""; }; 63AADBC51B6A0FF200AA16FD /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = ""; }; 63AADBC61B6A0FF200AA16FD /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; 63AADBC71B6A0FF200AA16FD /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; @@ -896,6 +894,9 @@ 63B81A0A1B57DA33009604A6 /* UIScrollView+TPKeyboardAvoidingAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+TPKeyboardAvoidingAdditions.h"; sourceTree = ""; }; 63B81A0B1B57DA33009604A6 /* UIScrollView+TPKeyboardAvoidingAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+TPKeyboardAvoidingAdditions.m"; sourceTree = ""; }; 63BC49D31BA1AA6F004EC273 /* UIChatBubbleTextCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIChatBubbleTextCell.xib; sourceTree = ""; }; + 63BC49E01BA2CDFC004EC273 /* UICallPausedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICallPausedCell.h; sourceTree = ""; }; + 63BC49E11BA2CDFC004EC273 /* UICallPausedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICallPausedCell.m; sourceTree = ""; }; + 63BC49E91BA2CEDF004EC273 /* UICallPausedCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UICallPausedCell.xib; sourceTree = ""; }; 63CD4B4D1A5AAC8C00B84282 /* DTAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTAlertView.h; sourceTree = ""; }; 63CD4B4E1A5AAC8C00B84282 /* DTAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTAlertView.m; sourceTree = ""; }; 63CFEDE21B9EDD36007EA5BD /* libswresample.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libswresample.a; path = "liblinphone-sdk/apple-darwin/lib/libswresample.a"; sourceTree = ""; }; @@ -921,8 +922,8 @@ D3128FDF15AABC7E00A2147A /* ContactDetailsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailsView.m; sourceTree = ""; }; D3196D3C15A32BD7007FEEBA /* UITransferButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITransferButton.h; sourceTree = ""; }; D3196D3D15A32BD8007FEEBA /* UITransferButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UITransferButton.m; sourceTree = ""; }; - D31AAF5C159B3919002C6B02 /* PausedCallsTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PausedCallsTableView.h; sourceTree = ""; }; - D31AAF5D159B3919002C6B02 /* PausedCallsTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PausedCallsTableView.m; sourceTree = ""; }; + D31AAF5C159B3919002C6B02 /* CallPausedTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallPausedTableView.h; sourceTree = ""; }; + D31AAF5D159B3919002C6B02 /* CallPausedTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallPausedTableView.m; sourceTree = ""; }; D31B4B1E159876C0002E6C72 /* UICompositeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICompositeView.h; sourceTree = ""; }; D31B4B1F159876C0002E6C72 /* UICompositeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICompositeView.m; sourceTree = ""; }; D31C9C96158A1CDE00756B45 /* UIHistoryCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIHistoryCell.h; sourceTree = ""; }; @@ -955,8 +956,6 @@ D35E7595159460560066B1C1 /* ChatsListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatsListView.m; sourceTree = ""; }; D35E759C159460B50066B1C1 /* SettingsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsView.h; sourceTree = ""; }; D35E759D159460B50066B1C1 /* SettingsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsView.m; sourceTree = ""; }; - D36C43C4158F2E5A0048BA40 /* UICallCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICallCell.h; sourceTree = ""; }; - D36C43C5158F2E5A0048BA40 /* UICallCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICallCell.m; sourceTree = ""; }; D36FB2D31589EF7C0036F6F2 /* UIPauseButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIPauseButton.h; sourceTree = ""; }; D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIPauseButton.m; sourceTree = ""; }; D378906215AC373B00BD776C /* ContactDetailsLabelView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailsLabelView.h; sourceTree = ""; }; @@ -1071,7 +1070,6 @@ F09548221883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ImageView.xib; sourceTree = ""; }; F09548231883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/CallView.xib; sourceTree = ""; }; F09548241883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/CallIncomingView.xib; sourceTree = ""; }; - F09548281883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UICallCell.xib; sourceTree = ""; }; F09548291883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UIConferenceHeader.xib; sourceTree = ""; }; F095482C1883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/TabBarView.xib; sourceTree = ""; }; F095482E1883F15500E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/AssistantView.xib; sourceTree = ""; }; @@ -1116,7 +1114,6 @@ F0AF06FB1A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/ImageView.strings; sourceTree = ""; }; F0AF06FC1A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/CallView.strings; sourceTree = ""; }; F0AF06FD1A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/CallIncomingView.strings; sourceTree = ""; }; - F0AF07011A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UICallCell.strings; sourceTree = ""; }; F0AF07021A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UIChatCell.strings; sourceTree = ""; }; F0AF07041A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UICompositeView.strings; sourceTree = ""; }; F0AF07051A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UIConferenceHeader.strings; sourceTree = ""; }; @@ -1293,8 +1290,8 @@ 6346100D1B61409800548952 /* CallOutgoingView.h */, 6346100E1B61409800548952 /* CallOutgoingView.m */, 634610101B6140A500548952 /* CallOutgoingView.xib */, - D31AAF5C159B3919002C6B02 /* PausedCallsTableView.h */, - D31AAF5D159B3919002C6B02 /* PausedCallsTableView.m */, + D31AAF5C159B3919002C6B02 /* CallPausedTableView.h */, + D31AAF5D159B3919002C6B02 /* CallPausedTableView.m */, D3F83EE91582021700336684 /* CallView.h */, D3F83EEA1582021700336684 /* CallView.m */, D381881C15FE3FCA00C3EDCA /* CallView.xib */, @@ -1393,9 +1390,9 @@ 22C7555F1317E59C007BC101 /* UIBluetoothButton.m */, 2214EB7812F846B1002A5394 /* UICallButton.h */, 2214EB7912F846B1002A5394 /* UICallButton.m */, - D36C43C4158F2E5A0048BA40 /* UICallCell.h */, - D36C43C5158F2E5A0048BA40 /* UICallCell.m */, - D381881415FE3F0B00C3EDCA /* UICallCell.xib */, + 63BC49E01BA2CDFC004EC273 /* UICallPausedCell.h */, + 63BC49E11BA2CDFC004EC273 /* UICallPausedCell.m */, + 63BC49E91BA2CEDF004EC273 /* UICallPausedCell.xib */, 22AA8AFF13D83F6300B30535 /* UICamSwitch.h */, 22AA8B0013D83F6300B30535 /* UICamSwitch.m */, 635173F71BA082A40095EB0A /* UIChatBubblePhotoCell.h */, @@ -2309,6 +2306,7 @@ 634CEDB61B6630DB00D7A921 /* chat_picture_default.png in Resources */, 634CEE0E1B6630DB00D7A921 /* status_away_desktop.png in Resources */, D38187B115FE340500C3EDCA /* ChatsListView.xib in Resources */, + 63BC49EA1BA2CEDF004EC273 /* UICallPausedCell.xib in Resources */, 631560381B69175F0047F4D3 /* color_E.png in Resources */, 63AADBFA1B6A0FF200AA16FD /* msg.wav in Resources */, 634CEDCE1B6630DB00D7A921 /* edit_list.png in Resources */, @@ -2396,7 +2394,6 @@ 634CEDD61B6630DB00D7A921 /* history_missed_default.png in Resources */, D37EE10D16035793003608A6 /* ImageView.xib in Resources */, 63AADBE81B6A0FF200AA16FD /* Localizable.strings in Resources */, - D381881115FE3F0B00C3EDCA /* UICallCell.xib in Resources */, 634CEDCA1B6630DB00D7A921 /* deselect_all.png in Resources */, 631348321B6FA53300C6BDCB /* rootca.pem in Resources */, 634CEDC51B6630DB00D7A921 /* contacts_sip_default.png in Resources */, @@ -2580,7 +2577,6 @@ D32648441588F6FC00930C67 /* UIToggleButton.m in Sources */, D36FB2D51589EF7C0036F6F2 /* UIPauseButton.m in Sources */, D31C9C98158A1CDF00756B45 /* UIHistoryCell.m in Sources */, - D36C43C6158F2E5A0048BA40 /* UICallCell.m in Sources */, D35E7597159460580066B1C1 /* ChatsListView.m in Sources */, D35E759F159460B70066B1C1 /* SettingsView.m in Sources */, 63B81A101B57DA33009604A6 /* UIScrollView+TPKeyboardAvoidingAdditions.m in Sources */, @@ -2594,7 +2590,7 @@ D3EA5411159853750037DC6B /* UIChatCell.m in Sources */, D3F26BF115986B73005F9CAB /* CallIncomingView.m in Sources */, D31B4B21159876C0002E6C72 /* UICompositeView.m in Sources */, - D31AAF5E159B3919002C6B02 /* PausedCallsTableView.m in Sources */, + D31AAF5E159B3919002C6B02 /* CallPausedTableView.m in Sources */, D3211BB0159C4EF10098460B /* UIConferenceHeader.m in Sources */, D32460E6159D9AAD00BA7F3A /* UITransparentView.m in Sources */, D32B9DFC15A2F131000B6DEC /* FastAddressBook.m in Sources */, @@ -2640,6 +2636,7 @@ D378AB2A15DCDB4A0098505D /* ImagePickerView.m in Sources */, 22405F001601C19200B92522 /* ImageView.m in Sources */, D3ED40191602172200BF332B /* HPGrowingTextView.m in Sources */, + 63BC49E21BA2CDFC004EC273 /* UICallPausedCell.m in Sources */, D3ED401B1602172200BF332B /* HPTextViewInternal.m in Sources */, D37EE162160377D7003608A6 /* DTActionSheet.m in Sources */, D306459E1611EC2A00BB571E /* UILoadingImageView.m in Sources */, @@ -2990,17 +2987,6 @@ path = LinphoneUI; sourceTree = ""; }; - D381881415FE3F0B00C3EDCA /* UICallCell.xib */ = { - isa = PBXVariantGroup; - children = ( - F09548281883F15400E8A69B /* Base */, - 639CEB0C1A1DF528004DE38F /* fr */, - 639CEB0D1A1DF52C004DE38F /* ru */, - F0AF07011A24BA770086C9C1 /* ar */, - ); - name = UICallCell.xib; - sourceTree = ""; - }; D381881C15FE3FCA00C3EDCA /* CallView.xib */ = { isa = PBXVariantGroup; children = (