From 191c8d8a2fa2a3c0e1708de1a04ed317facead40 Mon Sep 17 00:00:00 2001 From: Benjamin Verdier Date: Wed, 25 Jul 2018 11:43:32 +0200 Subject: [PATCH 01/16] Add views for call recording display --- Classes/LinphoneUI/UIRecordingCell.h | 19 +++ Classes/LinphoneUI/UIRecordingCell.m | 75 +++++++++++ Classes/LinphoneUI/UIRecordingCell.xib | 46 +++++++ Classes/RecordingsListTableView.h | 23 ++++ Classes/RecordingsListTableView.m | 179 +++++++++++++++++++++++++ Classes/RecordingsListView.h | 33 +++++ Classes/RecordingsListView.m | 97 ++++++++++++++ Classes/RecordingsListView.xib | 133 ++++++++++++++++++ Classes/SideMenuTableView.m | 6 + linphone.xcodeproj/project.pbxproj | 44 ++++-- 10 files changed, 646 insertions(+), 9 deletions(-) create mode 100644 Classes/LinphoneUI/UIRecordingCell.h create mode 100644 Classes/LinphoneUI/UIRecordingCell.m create mode 100644 Classes/LinphoneUI/UIRecordingCell.xib create mode 100644 Classes/RecordingsListTableView.h create mode 100644 Classes/RecordingsListTableView.m create mode 100644 Classes/RecordingsListView.h create mode 100644 Classes/RecordingsListView.m create mode 100644 Classes/RecordingsListView.xib diff --git a/Classes/LinphoneUI/UIRecordingCell.h b/Classes/LinphoneUI/UIRecordingCell.h new file mode 100644 index 000000000..accb53837 --- /dev/null +++ b/Classes/LinphoneUI/UIRecordingCell.h @@ -0,0 +1,19 @@ +// +// UIRecordingCell.h +// linphone +// +// Created by benjamin_verdier on 25/07/2018. +// + +#import + +@interface UIRecordingCell : UITableViewCell + +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UILabel *dateLabel; + +@property(nonatomic, assign) NSString *recording; + +- (id)initWithIdentifier:(NSString*)identifier; + +@end diff --git a/Classes/LinphoneUI/UIRecordingCell.m b/Classes/LinphoneUI/UIRecordingCell.m new file mode 100644 index 000000000..7451aa98a --- /dev/null +++ b/Classes/LinphoneUI/UIRecordingCell.m @@ -0,0 +1,75 @@ +// +// UIRecordingCell.m +// linphone +// +// Created by benjamin_verdier on 25/07/2018. +// + +#import "UIRecordingCell.h" +#import "PhoneMainView.h" +#import "UILabel+Boldify.h" +#import "Utils.h" + +@implementation UIRecordingCell + +#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]; + + // 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]; + self.recording = NULL; + } + return self; +} + +- (void)dealloc { + self.recording = NULL; + [NSNotificationCenter.defaultCenter removeObserver:self]; +} + +#pragma mark - Property Functions + +- (void)setRecording:(NSString *)arecording { + _recording = arecording; + if(_recording) { + //TODO: Parse file name to get name of contact and date + } +} + +#pragma mark - + +- (void)touchUp:(id)sender { + [self setHighlighted:true animated:true]; +} + +- (void)touchDown:(id)sender { + [self setHighlighted:false animated:true]; +} + +- (NSString *)accessibilityLabel { + return _nameLabel.text; +} + +- (void)setEditing:(BOOL)editing { + [self setEditing:editing animated:FALSE]; +} + +- (void)setEditing:(BOOL)editing animated:(BOOL)animated { + if (animated) { + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:0.3]; + } + if (animated) { + [UIView commitAnimations]; + } +} + + +@end diff --git a/Classes/LinphoneUI/UIRecordingCell.xib b/Classes/LinphoneUI/UIRecordingCell.xib new file mode 100644 index 000000000..cc5ad8588 --- /dev/null +++ b/Classes/LinphoneUI/UIRecordingCell.xib @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Classes/RecordingsListTableView.h b/Classes/RecordingsListTableView.h new file mode 100644 index 000000000..d8c003927 --- /dev/null +++ b/Classes/RecordingsListTableView.h @@ -0,0 +1,23 @@ +// +// RecordingsListTableView.h +// linphone +// +// Created by benjamin_verdier on 25/07/2018. +// + +#import + +#import "UICheckBoxTableView.h" + +#import "OrderedDictionary.h" + +@interface RecordingsListTableView : UICheckBoxTableView { +@private + OrderedDictionary *recordings; + //This has sub arrays indexed with the date of the recordings, themselves containings the recordings. +} +@property(nonatomic) BOOL ongoing; +- (void)loadData; +- (void)removeAllRecordings; + +@end diff --git a/Classes/RecordingsListTableView.m b/Classes/RecordingsListTableView.m new file mode 100644 index 000000000..41410f0a3 --- /dev/null +++ b/Classes/RecordingsListTableView.m @@ -0,0 +1,179 @@ +// +// RecordingsListTableView.m +// linphone +// +// Created by benjamin_verdier on 25/07/2018. +// + +#import "RecordingsListTableView.h" +#import "UIRecordingCell.h" +#import "LinphoneManager.h" +#import "PhoneMainView.h" +#import "Utils.h" + +@implementation RecordingsListTableView +NSArray *sortedRecordings; + +#pragma mark - Lifecycle Functions + +- (void)initRecordingsTableViewController { + recordings = [[OrderedDictionary alloc] init]; + sortedRecordings = [[NSArray alloc] init]; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + if (![self selectFirstRow]) { + //TODO: Make first cell expand to show player + } +} + +- (id)init { + self = [super init]; + if (self) { + [self initRecordingsTableViewController]; + } + _ongoing = FALSE; + return self; +} + +- (id)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (self) { + [self initRecordingsTableViewController]; + } + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [self removeAllRecordings]; +} + +- (void)removeAllRecordings { + for (NSInteger j = 0; j < [self.tableView numberOfSections]; ++j) { + for (NSInteger i = 0; i < [self.tableView numberOfRowsInSection:j]; ++i) { + [[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:j]] setRecording:nil]; + } + } +} + + +- (void)loadData { + _ongoing = TRUE; + LOGI(@"====>>>> Load recording list - Start"); + + //Clear recording cells + for (NSInteger j = 0; j < [self.tableView numberOfSections]; ++j){ + for (NSInteger i = 0; i < [self.tableView numberOfRowsInSection:j]; ++i) + { + [[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:j]] setContact:nil]; + } + } + + //TODO: Fill the recordings dictionnary with the recording names, keys are dates + + LOGI(@"====>>>> Load recording list - End"); + [super loadData]; + _ongoing = FALSE; +} + +#pragma mark - UITableViewDataSource Functions + +- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { + return [recordings allKeys]; +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return [recordings count]; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return [(OrderedDictionary *)[recordings objectForKey:[recordings keyAtIndex:section]] count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + NSString *kCellId = NSStringFromClass(UIRecordingCell.class); + UIRecordingCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; + if (cell == nil) { + cell = [[UIRecordingCell alloc] initWithIdentifier:kCellId]; + } + NSString *recording = @""; + //TODO: Set recording to the path of the recording + [cell setRecording:recording]; + [super accessoryForCell:cell atPath:indexPath]; + + return cell; +} + +- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { + CGRect frame = CGRectMake(0, 0, tableView.frame.size.width, tableView.sectionHeaderHeight); + UIView *tempView = [[UIView alloc] initWithFrame:frame]; + tempView.backgroundColor = [UIColor whiteColor]; + + UILabel *tempLabel = [[UILabel alloc] initWithFrame:frame]; + tempLabel.backgroundColor = [UIColor clearColor]; + tempLabel.textColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"color_A.png"]]; + tempLabel.text = [recordings keyAtIndex:section]; + tempLabel.textAlignment = NSTextAlignmentCenter; + tempLabel.font = [UIFont boldSystemFontOfSize:17]; + tempLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; + [tempView addSubview:tempLabel]; + + return tempView; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [super tableView:tableView didSelectRowAtIndexPath:indexPath]; + if (![self isEditing]) { + //TODO: Expand selected cell to display player + } +} + +- (void)tableView:(UITableView *)tableView +commitEditingStyle:(UITableViewCellEditingStyle)editingStyle +forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + [NSNotificationCenter.defaultCenter removeObserver:self]; + [tableView beginUpdates]; + + + NSString *date = [recordings keyAtIndex:[indexPath section]]; + NSMutableArray *subAr = [recordings objectForKey:date]; + //NSString *recording = subAr[indexPath.row]; + [subAr removeObjectAtIndex:indexPath.row]; + if (subAr.count == 0) { + [recordings removeObjectForKey:date]; + [tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] + withRowAnimation:UITableViewRowAnimationFade]; + } + + UIRecordingCell* cell = [self.tableView cellForRowAtIndexPath:indexPath]; + [cell setRecording:NULL]; + //TODO: Delete recording file here + [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; + [tableView endUpdates]; + + [self loadData]; + } +} + +- (void)removeSelectionUsing:(void (^)(NSIndexPath *))remover { + [super removeSelectionUsing:^(NSIndexPath *indexPath) { + [NSNotificationCenter.defaultCenter removeObserver:self]; + + NSString *date = [recordings keyAtIndex:[indexPath section]]; + NSMutableArray *subAr = [recordings objectForKey:date]; + //NSString *recording = subAr[indexPath.row]; + [subAr removeObjectAtIndex:indexPath.row]; + if (subAr.count == 0) { + [recordings removeObjectForKey:date]; + } + UIRecordingCell* cell = [self.tableView cellForRowAtIndexPath:indexPath]; + [cell setRecording:NULL]; + //TODO: Delete recording file here + }]; +} + + +@end diff --git a/Classes/RecordingsListView.h b/Classes/RecordingsListView.h new file mode 100644 index 000000000..f2b4458b9 --- /dev/null +++ b/Classes/RecordingsListView.h @@ -0,0 +1,33 @@ +// +// RecordingsListView.h +// linphone +// +// Created by benjamin_verdier on 25/07/2018. +// + +#import + +#import "UICompositeView.h" +#import "RecordingsListTableView.h" +#import "UIIconButton.h" + +typedef enum _RecordingSelectionMode { RecordingSelectionModeNone, RecordingSelectionModeEdit } RecordingSelectionMode; + +@interface RecordingSelection : NSObject { +} + ++ (void)setSelectionMode:(RecordingSelectionMode)selectionMode; ++ (RecordingSelectionMode)getSelectionMode; + +@end + +@interface RecordingsListView : UIViewController + +@property(strong, nonatomic) IBOutlet RecordingsListTableView *tableController; +@property(strong, nonatomic) IBOutlet UIView *topBar; +@property(weak, nonatomic) IBOutlet UIIconButton *deleteButton; + +- (IBAction)onDeleteClick:(id)sender; +- (IBAction)onEditionChangeClick:(id)sender; + +@end diff --git a/Classes/RecordingsListView.m b/Classes/RecordingsListView.m new file mode 100644 index 000000000..14c4e4d4a --- /dev/null +++ b/Classes/RecordingsListView.m @@ -0,0 +1,97 @@ +// +// RecordingsListView.m +// linphone +// +// Created by benjamin_verdier on 25/07/2018. +// + +#import "RecordingsListView.h" +#import "PhoneMainView.h" + +@implementation RecordingSelection + +static RecordingSelectionMode sSelectionMode = RecordingSelectionModeNone; + ++ (void)setSelectionMode:(RecordingSelectionMode)selectionMode { + sSelectionMode = selectionMode; +} + ++ (RecordingSelectionMode)getSelectionMode { + return sSelectionMode; +} + +@end + +@implementation RecordingsListView + +@synthesize tableController; +@synthesize topBar; + +#pragma mark - UICompositeViewDelegate Functions + +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if (compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:self.class + statusBar:StatusBarView.class + tabBar:TabBarView.class + sideMenu:SideMenuView.class + fullscreen:false + isLeftFragment:YES + fragmentWith:ContactDetailsView.class]; + } + return compositeDescription; +} + +- (UICompositeViewDescription *)compositeViewDescription { + return self.class.compositeViewDescription; +} + +#pragma mark - ViewController Functions + +- (void)viewDidLoad { + [super viewDidLoad]; + tableController.tableView.accessibilityIdentifier = @"Recordings table"; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + + if (tableController.isEditing) { + tableController.editing = NO; + } +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; +} + +- (void) viewWillDisappear:(BOOL)animated { + self.view = NULL; + [self.tableController removeAllRecordings]; +} + +#pragma mark - Action Functions + +- (IBAction)onDeleteClick:(id)sender { + NSString *msg = [NSString stringWithFormat:NSLocalizedString(@"Do you want to delete selected recordings?", nil)]; + [LinphoneManager.instance setContactsUpdated:TRUE]; + [UIConfirmationDialog ShowWithMessage:msg + cancelMessage:nil + confirmMessage:nil + onCancelClick:^() { + [self onEditionChangeClick:nil]; + } + onConfirmationClick:^() { + [tableController removeSelectionUsing:nil]; + [tableController loadData]; + [self onEditionChangeClick:nil]; + }]; +} + +- (IBAction)onEditionChangeClick:(id)sender { + _deleteButton.hidden = !self.tableController.isEditing; +} + +@end diff --git a/Classes/RecordingsListView.xib b/Classes/RecordingsListView.xib new file mode 100644 index 000000000..bee02a58e --- /dev/null +++ b/Classes/RecordingsListView.xib @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Classes/SideMenuTableView.m b/Classes/SideMenuTableView.m index 223908d4e..f611a3cb7 100644 --- a/Classes/SideMenuTableView.m +++ b/Classes/SideMenuTableView.m @@ -60,6 +60,12 @@ }]]; } + [_sideMenuEntries + addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"Recordings", nil) + tapBlock:^() { + [PhoneMainView.instance + changeCurrentView:AssistantView.compositeViewDescription]; + }]]; [_sideMenuEntries addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"Settings", nil) tapBlock:^() { diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index aa32a22ff..c776e19ea 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -745,6 +745,11 @@ C90FAA7915AF54E6002091CB /* HistoryDetailsView.m in Sources */ = {isa = PBXBuildFile; fileRef = C90FAA7715AF54E6002091CB /* HistoryDetailsView.m */; }; CF15F21E20E4F9A3008B1DE6 /* UIImageViewDeletable.m in Sources */ = {isa = PBXBuildFile; fileRef = CF15F21C20E4F9A3008B1DE6 /* UIImageViewDeletable.m */; }; CF15F21F20E4F9A3008B1DE6 /* UIImageViewDeletable.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF15F21D20E4F9A3008B1DE6 /* UIImageViewDeletable.xib */; }; + CF7602D7210867E800749F76 /* RecordingsListView.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7602D5210867E800749F76 /* RecordingsListView.m */; }; + CF7602D8210867E800749F76 /* RecordingsListView.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF7602D6210867E800749F76 /* RecordingsListView.xib */; }; + CF7602E221086EB200749F76 /* RecordingsListTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7602E021086EB200749F76 /* RecordingsListTableView.m */; }; + CF7602E72108759A00749F76 /* UIRecordingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7602E52108759A00749F76 /* UIRecordingCell.m */; }; + CF7602E82108759A00749F76 /* UIRecordingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF7602E62108759A00749F76 /* UIRecordingCell.xib */; }; CFBD7A2A20E504AE007C5286 /* delete_img.png in Resources */ = {isa = PBXBuildFile; fileRef = CFBD7A2320E504AD007C5286 /* delete_img.png */; }; D306459E1611EC2A00BB571E /* UILoadingImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = D306459D1611EC2900BB571E /* UILoadingImageView.m */; }; D3128FE115AABC7E00A2147A /* ContactDetailsView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3128FDF15AABC7E00A2147A /* ContactDetailsView.m */; }; @@ -1851,6 +1856,14 @@ CF15F21B20E4F9A3008B1DE6 /* UIImageViewDeletable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIImageViewDeletable.h; sourceTree = ""; }; CF15F21C20E4F9A3008B1DE6 /* UIImageViewDeletable.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIImageViewDeletable.m; sourceTree = ""; }; CF15F21D20E4F9A3008B1DE6 /* UIImageViewDeletable.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = UIImageViewDeletable.xib; sourceTree = ""; }; + CF7602D4210867E800749F76 /* RecordingsListView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecordingsListView.h; sourceTree = ""; }; + CF7602D5210867E800749F76 /* RecordingsListView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RecordingsListView.m; sourceTree = ""; }; + CF7602D6210867E800749F76 /* RecordingsListView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RecordingsListView.xib; sourceTree = ""; }; + CF7602DF21086EB100749F76 /* RecordingsListTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecordingsListTableView.h; sourceTree = ""; }; + CF7602E021086EB200749F76 /* RecordingsListTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RecordingsListTableView.m; sourceTree = ""; }; + CF7602E42108759A00749F76 /* UIRecordingCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIRecordingCell.h; sourceTree = ""; }; + CF7602E52108759A00749F76 /* UIRecordingCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIRecordingCell.m; sourceTree = ""; }; + CF7602E62108759A00749F76 /* UIRecordingCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = UIRecordingCell.xib; sourceTree = ""; }; CFBD7A2320E504AD007C5286 /* delete_img.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = delete_img.png; sourceTree = ""; }; D306459C1611EC2900BB571E /* UILoadingImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILoadingImageView.h; sourceTree = ""; }; D306459D1611EC2900BB571E /* UILoadingImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UILoadingImageView.m; sourceTree = ""; }; @@ -2205,12 +2218,6 @@ D3F83EEA1582021700336684 /* CallView.m */, D381881C15FE3FCA00C3EDCA /* CallView.xib */, 638F1A861C2167C2004B8E02 /* CallView~ipad.xib */, - 8CA70ACF1F9E0ABA00A3D2EB /* ChatConversationInfoView.h */, - 8CA70AD01F9E0AE100A3D2EB /* ChatConversationInfoView.m */, - 8CBD7BA220B6B7FD00E5DCC0 /* ChatConversationInfoView.xib */, - 8CD99A3D2090BA24008A7CDA /* ChatConversationImdnView.h */, - 8CD99A3B2090B9FA008A7CDA /* ChatConversationImdnView.m */, - 8CBD7BA520B6B80D00E5DCC0 /* ChatConversationImdnView.xib */, 8C9C5E0B1F83B2EF006987FA /* ChatConversationCreateCollectionViewController.h */, 8C9C5E0C1F83B2EF006987FA /* ChatConversationCreateCollectionViewController.m */, 6341807A1BBC103100F71761 /* ChatConversationCreateTableView.h */, @@ -2218,6 +2225,12 @@ 6336715E1BCBAAD200BFCBDE /* ChatConversationCreateView.h */, 6336715F1BCBAAD200BFCBDE /* ChatConversationCreateView.m */, 63B8D68E1BCBE65600C12B09 /* ChatConversationCreateView.xib */, + 8CD99A3D2090BA24008A7CDA /* ChatConversationImdnView.h */, + 8CD99A3B2090B9FA008A7CDA /* ChatConversationImdnView.m */, + 8CBD7BA520B6B80D00E5DCC0 /* ChatConversationImdnView.xib */, + 8CA70ACF1F9E0ABA00A3D2EB /* ChatConversationInfoView.h */, + 8CA70AD01F9E0AE100A3D2EB /* ChatConversationInfoView.m */, + 8CBD7BA220B6B7FD00E5DCC0 /* ChatConversationInfoView.xib */, D32B6E2715A5BC430033019F /* ChatConversationTableView.h */, D32B6E2815A5BC430033019F /* ChatConversationTableView.m */, D3F795D315A582800077328B /* ChatConversationView.h */, @@ -2238,9 +2251,9 @@ D35497FB15875372000081D8 /* ContactsListView.h */, D35497FC15875372000081D8 /* ContactsListView.m */, D38187C015FE342800C3EDCA /* ContactsListView.xib */, + 631098501D4660630041F2B3 /* CountryListView.xib */, 631098471D4660580041F2B3 /* CountryListView.h */, 631098481D4660580041F2B3 /* CountryListView.m */, - 631098501D4660630041F2B3 /* CountryListView.xib */, 22F2508B107141E100AC9B3F /* DialerView.h */, 22F2508C107141E100AC9B3F /* DialerView.m */, D38187C415FE345B00C3EDCA /* DialerView.xib */, @@ -2268,8 +2281,6 @@ 63E27A311C4FECD000D332AE /* LaunchScreen.xib */, 1D3623240D0F684500981E51 /* LinphoneAppDelegate.h */, 1D3623250D0F684500981E51 /* LinphoneAppDelegate.m */, - 8C2595D51DEDC8E1007A6424 /* ProviderDelegate.h */, - 8C2595DC1DEDC92D007A6424 /* ProviderDelegate.m */, D37DC6BF1594AE1800B2A5EB /* LinphoneCoreSettingsStore.h */, D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */, D3EA53FB159850E80037DC6B /* LinphoneManager.h */, @@ -2279,6 +2290,13 @@ D3F83F8C158229C500336684 /* PhoneMainView.h */, D3F83F8D15822ABD00336684 /* PhoneMainView.m */, 639E9CB31C0DB88200019A75 /* PhoneMainView.xib */, + 8C2595D51DEDC8E1007A6424 /* ProviderDelegate.h */, + 8C2595DC1DEDC92D007A6424 /* ProviderDelegate.m */, + CF7602DF21086EB100749F76 /* RecordingsListTableView.h */, + CF7602E021086EB200749F76 /* RecordingsListTableView.m */, + CF7602D4210867E800749F76 /* RecordingsListView.h */, + CF7602D5210867E800749F76 /* RecordingsListView.m */, + CF7602D6210867E800749F76 /* RecordingsListView.xib */, D35E759C159460B50066B1C1 /* SettingsView.h */, D35E759D159460B50066B1C1 /* SettingsView.m */, 636316D61A1DEC650009B839 /* SettingsView.xib */, @@ -2385,6 +2403,9 @@ 63701DDD1BA32039006A9AE3 /* UIConfirmationDialog.h */, 63701DDE1BA32039006A9AE3 /* UIConfirmationDialog.m */, 639E9CAB1C0DB7FB00019A75 /* UIConfirmationDialog.xib */, + CF7602E42108759A00749F76 /* UIRecordingCell.h */, + CF7602E52108759A00749F76 /* UIRecordingCell.m */, + CF7602E62108759A00749F76 /* UIRecordingCell.xib */, D3A55FBA15877E5E003FD403 /* UIContactCell.h */, D3A55FBB15877E5E003FD403 /* UIContactCell.m */, F088488D19FF8C41007FFCF3 /* UIContactCell.xib */, @@ -3818,6 +3839,7 @@ 633FEDE91D3CD5590014B822 /* call_status_missed~ipad@2x.png in Resources */, 8CE24F4C1F8234A30077AC0A /* next_default@2x.png in Resources */, 244523B11E8266CC0037A187 /* chat_read.png in Resources */, + CF7602D8210867E800749F76 /* RecordingsListView.xib in Resources */, 639E9CAC1C0DB80300019A75 /* UIContactDetailsCell.xib in Resources */, 633FEE511D3CD5590014B822 /* deselect_all@2x.png in Resources */, 8CF25D951F9F336100BEA0C1 /* check_unselected@2x.png in Resources */, @@ -3914,6 +3936,7 @@ 633FEEA41D3CD55A0014B822 /* numpad_1_default@2x.png in Resources */, 63E27A321C4FECD000D332AE /* LaunchScreen.xib in Resources */, 633FEED11D3CD55A0014B822 /* numpad_6~ipad.png in Resources */, + CF7602E82108759A00749F76 /* UIRecordingCell.xib in Resources */, 633FEED21D3CD55A0014B822 /* numpad_6~ipad@2x.png in Resources */, 633FEDCD1D3CD5590014B822 /* call_quality_indicator_0@2x.png in Resources */, 636316D41A1DEC650009B839 /* SettingsView.xib in Resources */, @@ -4384,6 +4407,7 @@ 34216F401547EBCD00EA9777 /* VideoZoomHandler.m in Sources */, D3F83EEC1582021700336684 /* CallView.m in Sources */, 8C2595DD1DEDC92D007A6424 /* ProviderDelegate.m in Sources */, + CF7602D7210867E800749F76 /* RecordingsListView.m in Sources */, 63F1DF4B1BCE983200EDED90 /* CallConferenceTableView.m in Sources */, D3F83F8E15822ABE00336684 /* PhoneMainView.m in Sources */, 6377AC801BDE4069007F7625 /* UIBackToCallButton.m in Sources */, @@ -4447,6 +4471,7 @@ D3807FC115C28940005BE9BC /* DCRoundSwitchKnobLayer.m in Sources */, 6306440E1BECB08500134C72 /* FirstLoginView.m in Sources */, D3807FC315C28940005BE9BC /* DCRoundSwitchOutlineLayer.m in Sources */, + CF7602E221086EB200749F76 /* RecordingsListTableView.m in Sources */, D3807FC515C28940005BE9BC /* DCRoundSwitchToggleLayer.m in Sources */, 633E41821D74259000320475 /* AssistantLinkView.m in Sources */, D3807FE815C2894A005BE9BC /* IASKAppSettingsViewController.m in Sources */, @@ -4459,6 +4484,7 @@ D3807FF215C2894A005BE9BC /* IASKSettingsStoreFile.m in Sources */, D3807FF415C2894A005BE9BC /* IASKSettingsStoreUserDefaults.m in Sources */, 639E9C801C0DB13D00019A75 /* UICheckBoxTableView.m in Sources */, + CF7602E72108759A00749F76 /* UIRecordingCell.m in Sources */, D3807FF615C2894A005BE9BC /* IASKSpecifier.m in Sources */, D3807FF815C2894A005BE9BC /* IASKPSSliderSpecifierViewCell.m in Sources */, D3807FFA15C2894A005BE9BC /* IASKPSTextFieldSpecifierViewCell.m in Sources */, From 0dc670ccb70e9e8da36442047bc1501d36ee1390 Mon Sep 17 00:00:00 2001 From: Benjamin Verdier Date: Wed, 25 Jul 2018 17:01:18 +0200 Subject: [PATCH 02/16] Add recorder button images --- Resources/images/rec_off_default.png | Bin 0 -> 597 bytes Resources/images/rec_off_default@2x.png | Bin 0 -> 1140 bytes Resources/images/rec_on_default.png | Bin 0 -> 689 bytes Resources/images/rec_on_default@2x.png | Bin 0 -> 1271 bytes linphone.xcodeproj/project.pbxproj | 96 ++++++++++++++---------- 5 files changed, 56 insertions(+), 40 deletions(-) create mode 100644 Resources/images/rec_off_default.png create mode 100644 Resources/images/rec_off_default@2x.png create mode 100644 Resources/images/rec_on_default.png create mode 100644 Resources/images/rec_on_default@2x.png diff --git a/Resources/images/rec_off_default.png b/Resources/images/rec_off_default.png new file mode 100644 index 0000000000000000000000000000000000000000..4dace8a7294ada50a7b34a277c28a26273bb9cf4 GIT binary patch literal 597 zcmV-b0;>IqP)0bZE$E!LjrDpxB_d5`E{RA@Lf3II_QWAO?-0~@f(vkQq`#0Y+jQ``V}+ZW#%s8*|ETI)B6=t5YxMnpdl(L3ww>$~nq2W}_4&2%9%b9j6Y0FEPK ztZVGA<>lo)xm+%2x7+vIwtWT>v*FkZ05||Jg@^_-|Kxezv+;QRO8500$JwKlI)jK) zVVwqm1|m*`uWP>VKW5wZ<;XfPitx5@o#Oz|CZc1m>t;O9+uv+959D&Wpj<9nwr$TN zVwRZ~UDwSRhOyT$jQy=vE6vQGA>u)$)TvUbbo28Ri$zpQokYYbW?t1=KUJ+(lZIjJ za$R>HGk=4KDa*1xEtktyWE~h)fE($;t`5{%>%3)I7kcMttzR?@<0EFiwzjtR@c8(6 zqxUPCN~JC#VupxbHcfLD03Zm0r%luRgqb-Af@!7H#qPRhvzZzj8~Ys*lfLgCR!S{L z`aker?!pgl6&?TpB0d?Op6U$`03e-Cx0w0EaPHBYAIvab2u~M!!vg?FBoZ~>_m2cY z@aR^<0|1B(!<~$ozaB9BP( z0AvSTBLIN8t{?3VkJsV5L$y$;`hX;@!z)@~r21)5T&D zyH+P}A>ymy%4VTcH#0Lc$IRa%qG?&yS3wXw-g(|@wOaR1Oiaun;yuh;fVn4}1<#-RNo^cNlS4aHu$Zb9m!0;Lx>^#`ZY8aPSr*?{L0Z zpUdSklBUdTSkkzps+nB{h@xn(q{os9lBUgUczk@k1E5?kXC*z6^i|Tlq}!vTqp3gU z%c0+)*2Y}y@W`R3v8PZd^mrXfcg<`dilV-`xw$QprX`KVaeT(iuGEd(T3TA_mNX;j zlbH>e*)>U#ncZyVtD`A<$C~DANdx9=PW?2R{KDk=Ii)XJj(0*`537ER(1D@RUH<>5rA|$J+?+S z6GAxb?mrsF05X}(+jcKZHJN)4d~c(x0u#VO>r|{VG3V~l)YR1GP^VNX?KHD~cb^O) zbVpIt*U;B$wUcIcVZDaf=5WuU+9GqW9Zods8<{h+q2}ky%gfvAL4Ov<@mVvwB3c%myW`NV@Yk9h-Hy;qb~~(&3}S1BcUVwfTI0lcbqAj?b-Kt5hln z>K$3AkB7x#acg~TpQNXfijo#3-OuH6nZG@RyMRN$j`|@y6JRm9GZPXL5)u*;{wY5J XrU{xkrlVPn00000NkvXXu0mjflzKsF literal 0 HcmV?d00001 diff --git a/Resources/images/rec_on_default@2x.png b/Resources/images/rec_on_default@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2bd2505c1a9e4f357926f6c0fd3dd15a61fc6a8f GIT binary patch literal 1271 zcmVhWe*kLuqR@p_+iARcXO4vZ)m}iY_doE_7uVZiFHdx|oG@ zC0&RvT#9tj=|U6)g@9@CU+aJs8Ipox?378Gj_G7F%=>%4>mujDZ8~rArpbVk^Ml8m zckexKhHuV&=Q|Hj6h%=KMNt$*Q4~c{6h%=KMNt$*Q4}SWT$V)^7?h8D0PJ+8Y5*z# znmM4U0;Y@i7=UL1i~`sVpkJo10Vo6b3BZLMa76{YS-iafjsiFW;86f~0vK@OA^;wM zzXALVpa7t_S+nsL@hmW5flC%xvOsJBTEIF7EnqC*S)goz&nz(RZ27j3{D$O}Mx!wl zMbQD0Uy@uP>5-hAnwsiO)>bN&t;U$+BrlMxk!+Iu-57IXc6N3k?K|e@=Ld~3?~%MH zadnbKk|&p!m+$MAc!L%=F5-DDgtIM#j4V(Q5g*U=Jp#!ONk-Ozr1}xkF37G@B0styzIoqB>!=)uLVIc)(!CvTHssBytTx0MGP!3ZGmGJ z*wKN25y`qS=562ihl3y(tJmxI0zj!$+Cs7@>%Q}Se>jP6G#dAl{7UA2C=?1k$y`34 z&yk#xx$AKpzgVeMwu-PLB+tv-OsQ1bve5!gSm3H`Tid}w3)C%eHcJ+|nGr?N!B%UG zF|Wy*a;;XoyVVvY`KPtk8e`r_#^X4CN#YoW;Vr+V(P#{jtXpes7=}-6q=1jeHtZz( z+#|HWMGL&J*0azN@Y6QW$kVw>p^0LbNXV*tk5+#?2X#u<80&U4*#D}Db1M>P*%JISNHy}f5Uh${oQ zM|MNk=xH%llMW+Vc_iM>V-z>!pWg^WU6Kq;ElPz#p(hA}eQp&7Fe7nKrp1L}_=GX$ z^`ts)R1w)>fm0T^E+)CtD(qQc(gNdIt8g60&$lTM#}X^Dw6wH6rO=#`HJ>G=_lU**d?0P$x&Zj}%GKCwV?93M{nUbETUMe^&!OfN1j-qnpZ?qg}sqKqOM3)IAbAIZ|rWf4$} z?=Z<3$M)PHSt8j;yq+=UofdH;B>!;Y0+Msi^>P$N&vdJu8y7!Vkq(1xwrwopowvYS zS-KF}dXpq8p6BgZvy!azwC|GqQF>aBR7FVrSw;5yJm;Sd-a+&0BBtL34 zo4dRDGGWjWaauZzP%Ee2MNt$*Q4~c{6h%=KMNt$* hQ4~c{6h--u@-JKOYM^S?AprmY002ovPDHLkV1g2TM(F?m literal 0 HcmV?d00001 diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index c776e19ea..2e27f3a54 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -750,6 +750,10 @@ CF7602E221086EB200749F76 /* RecordingsListTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7602E021086EB200749F76 /* RecordingsListTableView.m */; }; CF7602E72108759A00749F76 /* UIRecordingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7602E52108759A00749F76 /* UIRecordingCell.m */; }; CF7602E82108759A00749F76 /* UIRecordingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF7602E62108759A00749F76 /* UIRecordingCell.xib */; }; + CF7602F5210898CC00749F76 /* rec_off_default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CF7602EB210898C100749F76 /* rec_off_default@2x.png */; }; + CF7602F6210898CC00749F76 /* rec_on_default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CF7602F2210898C400749F76 /* rec_on_default@2x.png */; }; + CF7602F7210898CC00749F76 /* rec_off_default.png in Resources */ = {isa = PBXBuildFile; fileRef = CF7602F3210898C600749F76 /* rec_off_default.png */; }; + CF7602F8210898CC00749F76 /* rec_on_default.png in Resources */ = {isa = PBXBuildFile; fileRef = CF7602F4210898C800749F76 /* rec_on_default.png */; }; CFBD7A2A20E504AE007C5286 /* delete_img.png in Resources */ = {isa = PBXBuildFile; fileRef = CFBD7A2320E504AD007C5286 /* delete_img.png */; }; D306459E1611EC2A00BB571E /* UILoadingImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = D306459D1611EC2900BB571E /* UILoadingImageView.m */; }; D3128FE115AABC7E00A2147A /* ContactDetailsView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3128FDF15AABC7E00A2147A /* ContactDetailsView.m */; }; @@ -1864,6 +1868,10 @@ CF7602E42108759A00749F76 /* UIRecordingCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIRecordingCell.h; sourceTree = ""; }; CF7602E52108759A00749F76 /* UIRecordingCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIRecordingCell.m; sourceTree = ""; }; CF7602E62108759A00749F76 /* UIRecordingCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = UIRecordingCell.xib; sourceTree = ""; }; + CF7602EB210898C100749F76 /* rec_off_default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rec_off_default@2x.png"; sourceTree = ""; }; + CF7602F2210898C400749F76 /* rec_on_default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rec_on_default@2x.png"; sourceTree = ""; }; + CF7602F3210898C600749F76 /* rec_off_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rec_off_default.png; sourceTree = ""; }; + CF7602F4210898C800749F76 /* rec_on_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rec_on_default.png; sourceTree = ""; }; CFBD7A2320E504AD007C5286 /* delete_img.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = delete_img.png; sourceTree = ""; }; D306459C1611EC2900BB571E /* UILoadingImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILoadingImageView.h; sourceTree = ""; }; D306459D1611EC2900BB571E /* UILoadingImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UILoadingImageView.m; sourceTree = ""; }; @@ -2704,41 +2712,7 @@ 633FEBE11D3CD5570014B822 /* images */ = { isa = PBXGroup; children = ( - CFBD7A2320E504AD007C5286 /* delete_img.png */, - 24BFAA9B209B062F004F47A7 /* callkit_logo.png */, - 24BFAA99209B062E004F47A7 /* contacts_sip_default.png */, - 24BFAA94209B062C004F47A7 /* contacts_sip_default@2x.png */, - 24BFAA97209B062E004F47A7 /* contacts_sip_selected.png */, - 24BFAA9C209B062F004F47A7 /* contacts_sip_selected@2x.png */, - 24BFAA8C209B062B004F47A7 /* dialer_background.png */, - 24BFAA98209B062E004F47A7 /* linphone_logo.png */, - 24BFAA9D209B0630004F47A7 /* linphone_logo@2x.png */, - 24BFAA93209B062C004F47A7 /* linphone_user.png */, - 24BFAA95209B062D004F47A7 /* linphone_user@2x.png */, - 24BFAA9A209B062F004F47A7 /* linphone_user~ipad.png */, - 24BFAA96209B062D004F47A7 /* linphone_user~ipad@2x.png */, - 8CF25D9B1F9F76BC00BEA0C1 /* chat_group_informations.png */, - 8CF25D9C1F9F76BD00BEA0C1 /* chat_group_informations@2x.png */, - 8CF25D941F9F336100BEA0C1 /* check_unselected.png */, - 8CF25D8B1F9F336000BEA0C1 /* check_unselected@2x.png */, - 8CA70AD31F9E285B00A3D2EB /* chat_group_add.png */, - 8CA70AD21F9E285B00A3D2EB /* chat_group_add@2x.png */, - 8C2A81941F87B8000012A66B /* chat_group_avatar.png */, - 8C2A81931F87B7FF0012A66B /* chat_group_avatar@2x.png */, - 8CB2B8F61F86229B0015CEE2 /* chat_secure.png */, - 8CB2B8F71F86229C0015CEE2 /* next_disabled.png */, - 8CB2B8F81F86229D0015CEE2 /* next_disabled@2x.png */, - 8CDC61961F84D9270087CF7F /* check_selected@2x.png */, - 8CDC618C1F84D89B0087CF7F /* check_selected.png */, - 8CE24F551F8268840077AC0A /* conference_delete.png */, - 8CE24F561F8268840077AC0A /* conference_delete@2x.png */, - 8CE24F491F8234A20077AC0A /* next_default.png */, - 8CE24F4A1F8234A30077AC0A /* next_default@2x.png */, - 8C300D981E40E0CC00728EF3 /* lime_ko.png */, - 8C300D991E40E0CC00728EF3 /* lime_ko@2x.png */, - 8CD99A1B20908C27008A7CDA /* callkit_logo@2x.png */, 633FEBE21D3CD5570014B822 /* add_field_default.png */, - 244523BC1E8D3A6C0037A187 /* chat_unsecure.png */, 633FEBE31D3CD5570014B822 /* add_field_default@2x.png */, 633FEBE41D3CD5570014B822 /* add_field_over.png */, 633FEBE51D3CD5570014B822 /* add_field_over@2x.png */, @@ -2791,9 +2765,6 @@ 633FEC141D3CD5570014B822 /* call_quality_indicator_1.png */, 633FEC151D3CD5570014B822 /* call_quality_indicator_1@2x.png */, 633FEC161D3CD5570014B822 /* call_quality_indicator_2.png */, - 244523AC1E8266CC0037A187 /* chat_delivered.png */, - 244523AD1E8266CC0037A187 /* chat_error.png */, - 244523AE1E8266CC0037A187 /* chat_read.png */, 633FEC171D3CD5570014B822 /* call_quality_indicator_2@2x.png */, 633FEC181D3CD5570014B822 /* call_quality_indicator_3.png */, 633FEC191D3CD5570014B822 /* call_quality_indicator_3@2x.png */, @@ -2831,6 +2802,8 @@ 633FEC391D3CD5570014B822 /* call_video_start_default@2x.png */, 633FEC3A1D3CD5570014B822 /* call_video_start_disabled.png */, 633FEC3B1D3CD5570014B822 /* call_video_start_disabled@2x.png */, + 24BFAA9B209B062F004F47A7 /* callkit_logo.png */, + 8CD99A1B20908C27008A7CDA /* callkit_logo@2x.png */, 633FEC3C1D3CD5570014B822 /* camera_default.png */, 633FEC3D1D3CD5570014B822 /* camera_default@2x.png */, 633FEC3E1D3CD5570014B822 /* camera_disabled.png */, @@ -2857,10 +2830,20 @@ 633FEC531D3CD5570014B822 /* chat_attachment_disabled@2x.png */, 633FEC541D3CD5570014B822 /* chat_attachment_over.png */, 633FEC551D3CD5570014B822 /* chat_attachment_over@2x.png */, + 244523AC1E8266CC0037A187 /* chat_delivered.png */, + 244523AD1E8266CC0037A187 /* chat_error.png */, + 8CA70AD31F9E285B00A3D2EB /* chat_group_add.png */, + 8CA70AD21F9E285B00A3D2EB /* chat_group_add@2x.png */, + 8C2A81941F87B8000012A66B /* chat_group_avatar.png */, + 8C2A81931F87B7FF0012A66B /* chat_group_avatar@2x.png */, + 8CF25D9B1F9F76BC00BEA0C1 /* chat_group_informations.png */, + 8CF25D9C1F9F76BD00BEA0C1 /* chat_group_informations@2x.png */, 633FEC561D3CD5570014B822 /* chat_list_indicator~ipad.png */, 633FEC571D3CD5570014B822 /* chat_list_indicator~ipad@2x.png */, 633FEC581D3CD5570014B822 /* chat_message_not_delivered.png */, 633FEC591D3CD5570014B822 /* chat_message_not_delivered@2x.png */, + 244523AE1E8266CC0037A187 /* chat_read.png */, + 8CB2B8F61F86229B0015CEE2 /* chat_secure.png */, 633FEC5A1D3CD5570014B822 /* chat_send_default.png */, 633FEC5B1D3CD5570014B822 /* chat_send_default@2x.png */, 633FEC5C1D3CD5570014B822 /* chat_send_disabled.png */, @@ -2879,6 +2862,11 @@ 633FEC691D3CD5570014B822 /* chat_start_body_over@2x.png */, 633FEC6A1D3CD5570014B822 /* chat_start_body_over~ipad.png */, 633FEC6B1D3CD5570014B822 /* chat_start_body_over~ipad@2x.png */, + 244523BC1E8D3A6C0037A187 /* chat_unsecure.png */, + 8CDC618C1F84D89B0087CF7F /* check_selected.png */, + 8CDC61961F84D9270087CF7F /* check_selected@2x.png */, + 8CF25D941F9F336100BEA0C1 /* check_unselected.png */, + 8CF25D8B1F9F336000BEA0C1 /* check_unselected@2x.png */, 633FEC6C1D3CD5570014B822 /* checkbox_checked.png */, 633FEC6D1D3CD5570014B822 /* checkbox_checked@2x.png */, 633FEC6E1D3CD5570014B822 /* checkbox_unchecked.png */, @@ -2893,6 +2881,8 @@ 633FEC771D3CD5570014B822 /* color_I.png */, 633FEC781D3CD5570014B822 /* color_L.png */, 633FEC791D3CD5570014B822 /* color_M.png */, + 8CE24F551F8268840077AC0A /* conference_delete.png */, + 8CE24F561F8268840077AC0A /* conference_delete@2x.png */, 633FEC7A1D3CD5570014B822 /* conference_exit_default.png */, 633FEC7B1D3CD5570014B822 /* conference_exit_default@2x.png */, 633FEC7C1D3CD5570014B822 /* conference_exit_over.png */, @@ -2907,6 +2897,10 @@ 633FEC851D3CD5570014B822 /* contacts_all_disabled@2x.png */, 633FEC861D3CD5570014B822 /* contacts_all_selected.png */, 633FEC871D3CD5570014B822 /* contacts_all_selected@2x.png */, + 24BFAA99209B062E004F47A7 /* contacts_sip_default.png */, + 24BFAA94209B062C004F47A7 /* contacts_sip_default@2x.png */, + 24BFAA97209B062E004F47A7 /* contacts_sip_selected.png */, + 24BFAA9C209B062F004F47A7 /* contacts_sip_selected@2x.png */, 633FEC8E1D3CD5570014B822 /* delete_default.png */, 633FEC8F1D3CD5570014B822 /* delete_default@2x.png */, 633FEC901D3CD5570014B822 /* delete_disabled.png */, @@ -2915,6 +2909,7 @@ 633FEC931D3CD5570014B822 /* delete_field_default@2x.png */, 633FEC941D3CD5570014B822 /* delete_field_over.png */, 633FEC951D3CD5570014B822 /* delete_field_over@2x.png */, + CFBD7A2320E504AD007C5286 /* delete_img.png */, 633FEC961D3CD5570014B822 /* deselect_all.png */, 633FEC971D3CD5570014B822 /* deselect_all@2x.png */, 633FEC981D3CD5570014B822 /* dialer_alt_back.png */, @@ -2923,6 +2918,7 @@ 633FEC9B1D3CD5570014B822 /* dialer_back_default@2x.png */, 633FEC9C1D3CD5570014B822 /* dialer_back_disabled.png */, 633FEC9D1D3CD5570014B822 /* dialer_back_disabled@2x.png */, + 24BFAA8C209B062B004F47A7 /* dialer_background.png */, 633FECA01D3CD5570014B822 /* edit_default.png */, 633FECA11D3CD5570014B822 /* edit_default@2x.png */, 633FECA21D3CD5570014B822 /* edit_disabled.png */, @@ -2932,8 +2928,8 @@ 633FECA61D3CD5570014B822 /* edit_list_disabled.png */, 633FECA71D3CD5570014B822 /* edit_list_disabled@2x.png */, 633FECA81D3CD5570014B822 /* footer_chat_default.png */, - 633FECAA1D3CD5570014B822 /* footer_chat_disabled.png */, 633FECA91D3CD5570014B822 /* footer_chat_default@2x.png */, + 633FECAA1D3CD5570014B822 /* footer_chat_disabled.png */, 633FECAB1D3CD5570014B822 /* footer_chat_disabled@2x.png */, 633FECAC1D3CD5570014B822 /* footer_contacts_default.png */, 633FECAD1D3CD5570014B822 /* footer_contacts_default@2x.png */, @@ -2969,6 +2965,14 @@ 633FECCB1D3CD5570014B822 /* led_error@2x.png */, 633FECCC1D3CD5570014B822 /* led_inprogress.png */, 633FECCD1D3CD5570014B822 /* led_inprogress@2x.png */, + 8C300D981E40E0CC00728EF3 /* lime_ko.png */, + 8C300D991E40E0CC00728EF3 /* lime_ko@2x.png */, + 24BFAA98209B062E004F47A7 /* linphone_logo.png */, + 24BFAA9D209B0630004F47A7 /* linphone_logo@2x.png */, + 24BFAA93209B062C004F47A7 /* linphone_user.png */, + 24BFAA95209B062D004F47A7 /* linphone_user@2x.png */, + 24BFAA9A209B062F004F47A7 /* linphone_user~ipad.png */, + 24BFAA96209B062D004F47A7 /* linphone_user~ipad@2x.png */, 633FECD41D3CD5580014B822 /* list_details_default.png */, 633FECD51D3CD5580014B822 /* list_details_default@2x.png */, 633FECD61D3CD5580014B822 /* list_details_over.png */, @@ -2981,6 +2985,10 @@ 633FECDD1D3CD5580014B822 /* micro_disabled@2x.png */, 633FECDE1D3CD5580014B822 /* micro_selected.png */, 633FECDF1D3CD5580014B822 /* micro_selected@2x.png */, + 8CE24F491F8234A20077AC0A /* next_default.png */, + 8CE24F4A1F8234A30077AC0A /* next_default@2x.png */, + 8CB2B8F71F86229C0015CEE2 /* next_disabled.png */, + 8CB2B8F81F86229D0015CEE2 /* next_disabled@2x.png */, 633FECE01D3CD5580014B822 /* nowebcamCIF.jpg */, 633FECE11D3CD5580014B822 /* numpad_0_default.png */, 633FECE21D3CD5580014B822 /* numpad_0_default@2x.png */, @@ -3117,6 +3125,10 @@ 633FED651D3CD5590014B822 /* presence_online@2x.png */, 633FED661D3CD5590014B822 /* presence_unregistered.png */, 633FED671D3CD5590014B822 /* presence_unregistered@2x.png */, + CF7602F3210898C600749F76 /* rec_off_default.png */, + CF7602EB210898C100749F76 /* rec_off_default@2x.png */, + CF7602F4210898C800749F76 /* rec_on_default.png */, + CF7602F2210898C400749F76 /* rec_on_default@2x.png */, 633FED681D3CD5590014B822 /* route_bluetooth_default.png */, 633FED691D3CD5590014B822 /* route_bluetooth_default@2x.png */, 633FED6A1D3CD5590014B822 /* route_bluetooth_disabled.png */, @@ -3151,14 +3163,14 @@ 633FED871D3CD5590014B822 /* select_all_default@2x.png */, 633FED881D3CD5590014B822 /* select_all_disabled.png */, 633FED891D3CD5590014B822 /* select_all_disabled@2x.png */, - 8CD99A362090A824008A7CDA /* splashscreen.png */, - 8CD99A352090A823008A7CDA /* splashscreen@2x.png */, 633FED8A1D3CD5590014B822 /* speaker_default.png */, 633FED8B1D3CD5590014B822 /* speaker_default@2x.png */, 633FED8C1D3CD5590014B822 /* speaker_disabled.png */, 633FED8D1D3CD5590014B822 /* speaker_disabled@2x.png */, 633FED8E1D3CD5590014B822 /* speaker_selected.png */, 633FED8F1D3CD5590014B822 /* speaker_selected@2x.png */, + 8CD99A362090A824008A7CDA /* splashscreen.png */, + 8CD99A352090A823008A7CDA /* splashscreen@2x.png */, 633FED941D3CD5590014B822 /* valid_default.png */, 633FED951D3CD5590014B822 /* valid_default@2x.png */, 633FED961D3CD5590014B822 /* valid_disabled.png */, @@ -3708,6 +3720,7 @@ 636316D11A1DEBCB0009B839 /* AboutView.xib in Resources */, 8CBD7BA620B6B82400E5DCC0 /* UIChatConversationInfoTableViewCell.xib in Resources */, 244523AF1E8266CC0037A187 /* chat_delivered.png in Resources */, + CF7602F8210898CC00749F76 /* rec_on_default.png in Resources */, 633FEF481D3CD55A0014B822 /* speaker_selected.png in Resources */, 633FEED91D3CD55A0014B822 /* numpad_7~ipad.png in Resources */, 633FEE2B1D3CD5590014B822 /* color_C.png in Resources */, @@ -4005,6 +4018,7 @@ 633FEE8F1D3CD55A0014B822 /* list_details_default@2x.png in Resources */, 633FEE5E1D3CD5590014B822 /* edit_list_default.png in Resources */, 633FEDB11D3CD5590014B822 /* call_add_disabled@2x.png in Resources */, + CF7602F7210898CC00749F76 /* rec_off_default.png in Resources */, 633FEDB21D3CD5590014B822 /* call_alt_back_default.png in Resources */, 633FEE3D1D3CD5590014B822 /* contacts_all_default@2x.png in Resources */, 633FEF251D3CD55A0014B822 /* route_bluetooth_disabled@2x.png in Resources */, @@ -4121,6 +4135,7 @@ 633FEE851D3CD5590014B822 /* led_error@2x.png in Resources */, 633FEDBE1D3CD5590014B822 /* call_back_default.png in Resources */, 633FEF0F1D3CD55A0014B822 /* pause_big_default@2x.png in Resources */, + CF7602F6210898CC00749F76 /* rec_on_default@2x.png in Resources */, 633FEF081D3CD55A0014B822 /* options_start_conference_disabled.png in Resources */, 63F1DF511BCE986A00EDED90 /* UICallConferenceCell.xib in Resources */, 633FEE301D3CD5590014B822 /* color_H.png in Resources */, @@ -4192,6 +4207,7 @@ 639E9CA91C0DB7FB00019A75 /* UIConfirmationDialog.xib in Resources */, 633FEF111D3CD55A0014B822 /* pause_big_disabled@2x.png in Resources */, 633FEE321D3CD5590014B822 /* color_L.png in Resources */, + CF7602F5210898CC00749F76 /* rec_off_default@2x.png in Resources */, 633FEDB41D3CD5590014B822 /* call_alt_back_disabled.png in Resources */, 633FEE631D3CD5590014B822 /* footer_chat_default@2x.png in Resources */, 633FEE661D3CD5590014B822 /* footer_contacts_default.png in Resources */, From 498d5fa25b61dc3b2d738e929eee1169aaf42649 Mon Sep 17 00:00:00 2001 From: Benjamin Verdier Date: Wed, 25 Jul 2018 17:02:29 +0200 Subject: [PATCH 03/16] Add basis for call recording --- Classes/Base.lproj/CallView.xib | 537 +++++++++++++++++++++++++++++--- Classes/CallView.h | 3 + Classes/CallView.m | 28 ++ Classes/LinphoneManager.m | 10 + Classes/Utils/Utils.h | 2 + Classes/Utils/Utils.m | 24 ++ 6 files changed, 563 insertions(+), 41 deletions(-) diff --git a/Classes/Base.lproj/CallView.xib b/Classes/Base.lproj/CallView.xib index ab5f35348..e43709a09 100644 --- a/Classes/Base.lproj/CallView.xib +++ b/Classes/Base.lproj/CallView.xib @@ -1,5 +1,5 @@ - + @@ -42,6 +42,7 @@ + @@ -88,18 +89,18 @@ - + @@ -199,11 +200,11 @@ - + @@ -37,8 +35,9 @@ + - + From 8796f8b2d804ef3bc3609f056337f1e67d5b8d75 Mon Sep 17 00:00:00 2001 From: Benjamin Verdier Date: Thu, 26 Jul 2018 16:25:22 +0200 Subject: [PATCH 10/16] Adding player almost done --- Classes/LinphoneUI/UILinphoneAudioPlayer.h | 25 +++ Classes/LinphoneUI/UILinphoneAudioPlayer.m | 196 +++++++++++++++++++ Classes/LinphoneUI/UILinphoneAudioPlayer.xib | 85 ++++++++ Classes/LinphoneUI/UIRecordingCell.m | 12 ++ linphone.xcodeproj/project.pbxproj | 53 ++--- 5 files changed, 349 insertions(+), 22 deletions(-) create mode 100644 Classes/LinphoneUI/UILinphoneAudioPlayer.h create mode 100644 Classes/LinphoneUI/UILinphoneAudioPlayer.m create mode 100644 Classes/LinphoneUI/UILinphoneAudioPlayer.xib diff --git a/Classes/LinphoneUI/UILinphoneAudioPlayer.h b/Classes/LinphoneUI/UILinphoneAudioPlayer.h new file mode 100644 index 000000000..e77e5319e --- /dev/null +++ b/Classes/LinphoneUI/UILinphoneAudioPlayer.h @@ -0,0 +1,25 @@ +// +// UILinphoneAudioPlayer.h +// linphone +// +// Created by David Idmansour on 13/07/2018. +// + +#import + +@interface UILinphoneAudioPlayer : UIViewController +@property (weak, nonatomic) IBOutlet UIButton *playButton; +@property (weak, nonatomic) IBOutlet UIButton *stopButton; +@property (weak, nonatomic) IBOutlet UILabel *timeLabel; +@property (weak, nonatomic) IBOutlet UIProgressView *timeProgress; + ++ (id)audioPlayerWithFilePath:(NSString *)filePath; +- (void)close; +- (BOOL)isOpened; +- (void)open; +- (void)pause; +- (void)setFile:(NSString *)fileName; +- (IBAction)onPlay:(id)sender; +- (IBAction)onStop:(id)sender; +- (IBAction)onTapTimeBar:(UITapGestureRecognizer *)sender; +@end diff --git a/Classes/LinphoneUI/UILinphoneAudioPlayer.m b/Classes/LinphoneUI/UILinphoneAudioPlayer.m new file mode 100644 index 000000000..542cf28d5 --- /dev/null +++ b/Classes/LinphoneUI/UILinphoneAudioPlayer.m @@ -0,0 +1,196 @@ +// +// UILinphoneAudioPlayer.m +// linphone +// +// Created by David Idmansour on 13/07/2018. +// + +#import "UILinphoneAudioPlayer.h" +#import "Utils.h" + +@implementation UILinphoneAudioPlayer { + @private + LinphonePlayer *player; + LinphonePlayerCbs *cbs; + NSString *file; + int duration; + BOOL eofReached; +} + +#pragma mark - Factory + ++ (id)audioPlayerWithFilePath:(NSString *)filePath { + return [[self alloc] initWithFilePath:filePath]; +} + +#pragma mark - Life cycle + +- (instancetype)initWithFilePath:(NSString *)filePath { + if (self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]]) { + player = linphone_core_create_local_player(LC, NULL, NULL, NULL); + cbs = linphone_player_get_callbacks(player); + linphone_player_set_user_data(player, (__bridge void *)self); + linphone_player_cbs_set_eof_reached(cbs, on_eof_reached); + file = filePath; + eofReached = NO; + } + return self; +} + +- (void)dealloc { + [self close]; +} + +- (void)close { + if (player) { + linphone_player_unref(player); + player = NULL; + } + [self.view removeFromSuperview]; +} + +- (void)open { + linphone_player_open(player, file.UTF8String); + duration = linphone_player_get_duration(player); + [self updateTimeLabel:0]; + _timeProgress.progress = 0; + eofReached = NO; + [_playButton setTitle:@"" forState:UIControlStateNormal]; + [_playButton setImage:[UIImage imageFromSystemBarButton:UIBarButtonSystemItemPlay:[UIColor blackColor]] forState:UIControlStateNormal]; + [_stopButton setTitle:@"" forState:UIControlStateNormal]; + [_stopButton setImage:[UIImage imageFromSystemBarButton:UIBarButtonSystemItemRefresh:[UIColor blackColor]] forState:UIControlStateNormal]; +} + +- (BOOL)isOpened { + return player && linphone_player_get_state(player) != LinphonePlayerClosed; +} + +- (void)setFile:(NSString *)fileName { + linphone_player_close(player); + file = fileName; +} + +#pragma mark - Callbacks + +void on_eof_reached(LinphonePlayer *pl) { + NSLog(@"EOF reached"); + UILinphoneAudioPlayer *player = (__bridge UILinphoneAudioPlayer *)linphone_player_get_user_data(pl); + dispatch_async(dispatch_get_main_queue(), ^{ + [player.playButton setTitle:@"" forState:UIControlStateNormal]; + [player.playButton setImage:[UIImage imageFromSystemBarButton:UIBarButtonSystemItemPlay:[UIColor blackColor]] forState:UIControlStateNormal]; + }); + player->eofReached = YES; +} + +#pragma mark - ViewController methods + +- (void)viewDidLoad { + [super viewDidLoad]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +#pragma mark - Utils + ++ (NSString *)timeToString:(int)time { + time /= 1000; + int hours = time / 3600; + time %= 3600; + int minutes = time / 60; + int seconds = time % 60; + NSNumberFormatter *formatter = [NSNumberFormatter new]; + formatter.maximumIntegerDigits = 2; + formatter.minimumIntegerDigits = 2; + NSString *ret = [NSString stringWithFormat:@"%@:%@", + [formatter stringFromNumber:[NSNumber numberWithInt:minutes]], + [formatter stringFromNumber:[NSNumber numberWithInt:seconds]]]; + ret = (hours == 0)?ret:[[NSString stringWithFormat:@"%d:", hours] stringByAppendingString:ret]; + return ret; +} + +#pragma mark - Updating + +- (void)updateTimeLabel:(int)currentTime { + _timeLabel.text = [NSString stringWithFormat:@"%@ / %@", [self.class timeToString:currentTime], [self.class timeToString:duration]]; +} + +- (void)update { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ + while (player && linphone_player_get_state(player) == LinphonePlayerPlaying) { + int start = linphone_player_get_current_position(player); + while (player && start + 100 < duration && start + 100 > linphone_player_get_current_position(player)) { + [NSThread sleepForTimeInterval:0.01]; + if (!player || linphone_player_get_state(player) == LinphonePlayerPaused) + break; + } + start = player ? linphone_player_get_current_position(player) : start; + dispatch_async(dispatch_get_main_queue(), ^{ + _timeProgress.progress = (float)start / (float)duration; + [self updateTimeLabel:start]; + }); + } + }); +} + +- (void)pause { + if ([self isOpened]) { + linphone_player_pause(player); + [_playButton setTitle:@"" forState:UIControlStateNormal]; + [_playButton setImage:[UIImage imageFromSystemBarButton:UIBarButtonSystemItemPlay:[UIColor blackColor]] forState:UIControlStateNormal]; + } +} + +#pragma mark - Event handlers + +- (IBAction)onPlay:(id)sender { + if (eofReached) { + linphone_player_seek(player, 0); + eofReached = NO; + } + LinphonePlayerState state = linphone_player_get_state(player); + switch (state) { + case LinphonePlayerClosed: + break; + case LinphonePlayerPaused: + NSLog(@"Play"); + [_playButton setTitle:@"" forState:UIControlStateNormal]; + [_playButton setImage:[UIImage imageFromSystemBarButton:UIBarButtonSystemItemPause:[UIColor blackColor]] forState:UIControlStateNormal]; + linphone_player_start(player); + break; + case LinphonePlayerPlaying: + NSLog(@"Pause"); + [_playButton setTitle:@"" forState:UIControlStateNormal]; + [_playButton setImage:[UIImage imageFromSystemBarButton:UIBarButtonSystemItemPlay:[UIColor blackColor]] forState:UIControlStateNormal]; + linphone_player_pause(player); + break; + } + [self update]; +} + +- (IBAction)onStop:(id)sender { + NSLog(@"Stop"); + linphone_player_pause(player); + linphone_player_seek(player, 0); + eofReached = NO; + [_playButton setTitle:@"" forState:UIControlStateNormal]; + [_playButton setImage:[UIImage imageFromSystemBarButton:UIBarButtonSystemItemPlay:[UIColor blackColor]] forState:UIControlStateNormal]; + _timeProgress.progress = 0; + [self updateTimeLabel:0]; +} + +- (IBAction)onTapTimeBar:(UITapGestureRecognizer *)sender { + if (sender.state != UIGestureRecognizerStateEnded) + return; + CGPoint loc = [sender locationInView:self.view]; + CGPoint timeLoc = _timeProgress.frame.origin; + CGSize timeSize = _timeProgress.frame.size; + if (loc.x >= timeLoc.x && loc.x <= timeLoc.x + timeSize.width && loc.y >= timeLoc.y - 10 && loc.y <= timeLoc.y + timeSize.height + 10) { + float progress = (loc.x - timeLoc.x) / timeSize.width; + _timeProgress.progress = progress; + [self updateTimeLabel:(int)(progress * duration)]; + linphone_player_seek(player, (int)(progress * duration)); + } +} +@end diff --git a/Classes/LinphoneUI/UILinphoneAudioPlayer.xib b/Classes/LinphoneUI/UILinphoneAudioPlayer.xib new file mode 100644 index 000000000..1349da0cf --- /dev/null +++ b/Classes/LinphoneUI/UILinphoneAudioPlayer.xib @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Classes/LinphoneUI/UIRecordingCell.m b/Classes/LinphoneUI/UIRecordingCell.m index d5544dbc4..534479e93 100644 --- a/Classes/LinphoneUI/UIRecordingCell.m +++ b/Classes/LinphoneUI/UIRecordingCell.m @@ -85,7 +85,19 @@ static UILinphoneAudioPlayer *player; } - (void)setSelected:(BOOL)selected { + if (!selected) + return; + if (!player) + player = [UILinphoneAudioPlayer audioPlayerWithFilePath:[self recording]]; + else + [player setFile:[self recording]]; + UILinphoneAudioPlayer *p = player; + [p.view removeFromSuperview]; + [self addSubview:p.view]; + [self bringSubviewToFront:p.view]; + p.view.frame = _playerView.frame; + p.view.bounds = _playerView.bounds; } diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 2e27f3a54..11ddb5bd6 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -745,6 +745,8 @@ C90FAA7915AF54E6002091CB /* HistoryDetailsView.m in Sources */ = {isa = PBXBuildFile; fileRef = C90FAA7715AF54E6002091CB /* HistoryDetailsView.m */; }; CF15F21E20E4F9A3008B1DE6 /* UIImageViewDeletable.m in Sources */ = {isa = PBXBuildFile; fileRef = CF15F21C20E4F9A3008B1DE6 /* UIImageViewDeletable.m */; }; CF15F21F20E4F9A3008B1DE6 /* UIImageViewDeletable.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF15F21D20E4F9A3008B1DE6 /* UIImageViewDeletable.xib */; }; + CF1DE92D210A0F5D00A0A97E /* UILinphoneAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = CF1DE924210A0F5A00A0A97E /* UILinphoneAudioPlayer.m */; }; + CF1DE92E210A0F5D00A0A97E /* UILinphoneAudioPlayer.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF1DE92B210A0F5B00A0A97E /* UILinphoneAudioPlayer.xib */; }; CF7602D7210867E800749F76 /* RecordingsListView.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7602D5210867E800749F76 /* RecordingsListView.m */; }; CF7602D8210867E800749F76 /* RecordingsListView.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF7602D6210867E800749F76 /* RecordingsListView.xib */; }; CF7602E221086EB200749F76 /* RecordingsListTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = CF7602E021086EB200749F76 /* RecordingsListTableView.m */; }; @@ -1761,7 +1763,6 @@ 8C5BCECC1EB3859200A9AAEF /* mswebrtc.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mswebrtc.framework; path = "liblinphone-sdk/apple-darwin/Frameworks/mswebrtc.framework"; sourceTree = ""; }; 8C5BCECD1EB3859200A9AAEF /* ortp.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ortp.framework; path = "liblinphone-sdk/apple-darwin/Frameworks/ortp.framework"; sourceTree = ""; }; 8C5D1B991D9BC48100DC6539 /* UIShopTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIShopTableCell.h; sourceTree = ""; }; - 8C5D1B9A1D9BC48100DC6539 /* UIShopTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIShopTableCell.m; sourceTree = ""; }; 8C5D1B9B1D9BC48100DC6539 /* UIShopTableCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIShopTableCell.xib; sourceTree = ""; }; 8C601FD220B462B0004FF95C /* mediastreamer2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mediastreamer2.framework; path = "liblinphone-sdk/apple-darwin/Frameworks/mediastreamer2.framework"; sourceTree = ""; }; 8C73477B1D9BA3A00022EE8C /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; }; @@ -1860,6 +1861,9 @@ CF15F21B20E4F9A3008B1DE6 /* UIImageViewDeletable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIImageViewDeletable.h; sourceTree = ""; }; CF15F21C20E4F9A3008B1DE6 /* UIImageViewDeletable.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIImageViewDeletable.m; sourceTree = ""; }; CF15F21D20E4F9A3008B1DE6 /* UIImageViewDeletable.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = UIImageViewDeletable.xib; sourceTree = ""; }; + CF1DE924210A0F5A00A0A97E /* UILinphoneAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UILinphoneAudioPlayer.m; sourceTree = ""; }; + CF1DE92B210A0F5B00A0A97E /* UILinphoneAudioPlayer.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UILinphoneAudioPlayer.xib; sourceTree = ""; }; + CF1DE92C210A0F5C00A0A97E /* UILinphoneAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILinphoneAudioPlayer.h; sourceTree = ""; }; CF7602D4210867E800749F76 /* RecordingsListView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecordingsListView.h; sourceTree = ""; }; CF7602D5210867E800749F76 /* RecordingsListView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RecordingsListView.m; sourceTree = ""; }; CF7602D6210867E800749F76 /* RecordingsListView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RecordingsListView.xib; sourceTree = ""; }; @@ -2350,9 +2354,6 @@ 2214EB7012F84668002A5394 /* LinphoneUI */ = { isa = PBXGroup; children = ( - CF15F21B20E4F9A3008B1DE6 /* UIImageViewDeletable.h */, - CF15F21C20E4F9A3008B1DE6 /* UIImageViewDeletable.m */, - CF15F21D20E4F9A3008B1DE6 /* UIImageViewDeletable.xib */, 63F1DF421BCE618E00EDED90 /* UIAddressTextField.h */, 63F1DF431BCE618E00EDED90 /* UIAddressTextField.m */, 63C441C11BBC23ED0053DC5E /* UIAssistantTextField.h */, @@ -2381,27 +2382,24 @@ D3A8BB6E15A6C7D500F96BE5 /* UIChatBubbleTextCell.h */, D3A8BB6F15A6C7D500F96BE5 /* UIChatBubbleTextCell.m */, 639E9CA51C0DB7EA00019A75 /* UIChatBubbleTextCell.xib */, - 8C92ABF11FA773C20006FB5D /* UIChatNotifiedEventCell.h */, - 8C92ABF21FA773E50006FB5D /* UIChatNotifiedEventCell.m */, - 8C92ABE71FA773190006FB5D /* UIChatNotifiedEventCell.xib */, D3EA540F159853750037DC6B /* UIChatCell.h */, D3EA5410159853750037DC6B /* UIChatCell.m */, 639CEB0B1A1DF4FA004DE38F /* UIChatCell.xib */, - 8CA70AE11F9E39E400A3D2EB /* UIChatConversationInfoTableViewCell.h */, - 8CA70AE21F9E39E400A3D2EB /* UIChatConversationInfoTableViewCell.m */, - 8CBD7BA820B6B82400E5DCC0 /* UIChatConversationInfoTableViewCell.xib */, 8CD99A402090CE25008A7CDA /* UIChatConversationImdnTableViewCell.h */, 8CD99A412090CE6F008A7CDA /* UIChatConversationImdnTableViewCell.m */, 8CBD7BAB20B6B82A00E5DCC0 /* UIChatConversationImdnTableViewCell.xib */, - 8C9C5E0E1F83BD97006987FA /* UIChatCreateCollectionViewCell.h */, - 8C9C5E0F1F83BD97006987FA /* UIChatCreateCollectionViewCell.m */, - 8CBD7BAE20B6B82F00E5DCC0 /* UIChatCreateCollectionViewCell.xib */, + 8CA70AE11F9E39E400A3D2EB /* UIChatConversationInfoTableViewCell.h */, + 8CA70AE21F9E39E400A3D2EB /* UIChatConversationInfoTableViewCell.m */, + 8CBD7BA820B6B82400E5DCC0 /* UIChatConversationInfoTableViewCell.xib */, 63B8D69F1BCBF43100C12B09 /* UIChatCreateCell.h */, 63B8D6A01BCBF43100C12B09 /* UIChatCreateCell.m */, 639E9CA81C0DB7F200019A75 /* UIChatCreateCell.xib */, - 8C5D1B991D9BC48100DC6539 /* UIShopTableCell.h */, - 8C5D1B9A1D9BC48100DC6539 /* UIShopTableCell.m */, - 8C5D1B9B1D9BC48100DC6539 /* UIShopTableCell.xib */, + 8C9C5E0E1F83BD97006987FA /* UIChatCreateCollectionViewCell.h */, + 8C9C5E0F1F83BD97006987FA /* UIChatCreateCollectionViewCell.m */, + 8CBD7BAE20B6B82F00E5DCC0 /* UIChatCreateCollectionViewCell.xib */, + 8C92ABF11FA773C20006FB5D /* UIChatNotifiedEventCell.h */, + 8C92ABF21FA773E50006FB5D /* UIChatNotifiedEventCell.m */, + 8C92ABE71FA773190006FB5D /* UIChatNotifiedEventCell.xib */, 639E9C7E1C0DB13D00019A75 /* UICheckBoxTableView.h */, 639E9C7F1C0DB13D00019A75 /* UICheckBoxTableView.m */, D31B4B1E159876C0002E6C72 /* UICompositeView.h */, @@ -2411,15 +2409,9 @@ 63701DDD1BA32039006A9AE3 /* UIConfirmationDialog.h */, 63701DDE1BA32039006A9AE3 /* UIConfirmationDialog.m */, 639E9CAB1C0DB7FB00019A75 /* UIConfirmationDialog.xib */, - CF7602E42108759A00749F76 /* UIRecordingCell.h */, - CF7602E52108759A00749F76 /* UIRecordingCell.m */, - CF7602E62108759A00749F76 /* UIRecordingCell.xib */, D3A55FBA15877E5E003FD403 /* UIContactCell.h */, D3A55FBB15877E5E003FD403 /* UIContactCell.m */, F088488D19FF8C41007FFCF3 /* UIContactCell.xib */, - 24A345A71D95799900881A5C /* UIShopTableCell.h */, - 24A345A51D95798A00881A5C /* UIShopTableCell.m */, - 24A3459D1D95797700881A5C /* UIShopTableCell.xib */, D3C6526515AC1A8F0092A874 /* UIContactDetailsCell.h */, D3C6526615AC1A8F0092A874 /* UIContactDetailsCell.m */, 639E9CAE1C0DB80300019A75 /* UIContactDetailsCell.xib */, @@ -2432,18 +2424,31 @@ 639CEB021A1DF4E4004DE38F /* UIHistoryCell.xib */, 636BC9951B5F921B00C754CE /* UIIconButton.h */, 636BC9961B5F921B00C754CE /* UIIconButton.m */, + CF15F21B20E4F9A3008B1DE6 /* UIImageViewDeletable.h */, + CF15F21C20E4F9A3008B1DE6 /* UIImageViewDeletable.m */, + CF15F21D20E4F9A3008B1DE6 /* UIImageViewDeletable.xib */, 634610041B61330300548952 /* UILabel+Boldify.h */, 634610051B61330300548952 /* UILabel+Boldify.m */, + CF1DE92C210A0F5C00A0A97E /* UILinphoneAudioPlayer.h */, + CF1DE924210A0F5A00A0A97E /* UILinphoneAudioPlayer.m */, + CF1DE92B210A0F5B00A0A97E /* UILinphoneAudioPlayer.xib */, D306459C1611EC2900BB571E /* UILoadingImageView.h */, D306459D1611EC2900BB571E /* UILoadingImageView.m */, 2214EBF112F86360002A5394 /* UIMutedMicroButton.h */, 2214EBF212F86360002A5394 /* UIMutedMicroButton.m */, D36FB2D31589EF7C0036F6F2 /* UIPauseButton.h */, D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */, + CF7602E42108759A00749F76 /* UIRecordingCell.h */, + CF7602E52108759A00749F76 /* UIRecordingCell.m */, + CF7602E62108759A00749F76 /* UIRecordingCell.xib */, 6313482E1B6F7B6600C6BDCB /* UIRoundBorderedButton.h */, 6313482F1B6F7B6600C6BDCB /* UIRoundBorderedButton.m */, 63FB30331A680E73008CA393 /* UIRoundedImageView.h */, 63FB30341A680E73008CA393 /* UIRoundedImageView.m */, + 8C5D1B991D9BC48100DC6539 /* UIShopTableCell.h */, + 24A345A51D95798A00881A5C /* UIShopTableCell.m */, + 8C5D1B9B1D9BC48100DC6539 /* UIShopTableCell.xib */, + 24A345A71D95799900881A5C /* UIShopTableCell.h */, 22968A5D12F875C600588287 /* UISpeakerButton.h */, 22968A5E12F875C600588287 /* UISpeakerButton.m */, 630CF5551AF7CE1500539F7A /* UITextField+DoneButton.h */, @@ -2454,6 +2459,8 @@ D32648431588F6FB00930C67 /* UIToggleButton.m */, 340751E5150F38FC00B89C47 /* UIVideoButton.h */, 340751E6150F38FD00B89C47 /* UIVideoButton.m */, + 24A345A51D95798A00881A5C /* UIShopTableCell.m */, + 24A3459D1D95797700881A5C /* UIShopTableCell.xib */, ); path = LinphoneUI; sourceTree = ""; @@ -4069,6 +4076,7 @@ 633FEEA81D3CD55A0014B822 /* numpad_1_over~ipad@2x.png in Resources */, D38187AD15FE340100C3EDCA /* ChatConversationView.xib in Resources */, 633FEE7C1D3CD5590014B822 /* history_missed_disabled.png in Resources */, + CF1DE92E210A0F5D00A0A97E /* UILinphoneAudioPlayer.xib in Resources */, 633FEDF11D3CD5590014B822 /* call_transfer_disabled@2x.png in Resources */, 633FEDFF1D3CD5590014B822 /* camera_switch_disabled@2x.png in Resources */, 633FEDDF1D3CD5590014B822 /* call_start_body_over@2x.png in Resources */, @@ -4394,6 +4402,7 @@ buildActionMask = 2147483647; files = ( 63B81A0F1B57DA33009604A6 /* TPKeyboardAvoidingTableView.m in Sources */, + CF1DE92D210A0F5D00A0A97E /* UILinphoneAudioPlayer.m in Sources */, 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 8CD99A3C2090B9FA008A7CDA /* ChatConversationImdnView.m in Sources */, 1D3623260D0F684500981E51 /* LinphoneAppDelegate.m in Sources */, From f11fb7388aa3e5c82947d90df2016cca5080b61c Mon Sep 17 00:00:00 2001 From: Benjamin Verdier Date: Thu, 26 Jul 2018 16:41:16 +0200 Subject: [PATCH 11/16] Finish adding player --- Classes/LinphoneUI/UIRecordingCell.m | 19 ++++++++++--------- Classes/Utils/Utils.h | 6 ++++++ Classes/Utils/Utils.m | 23 +++++++++++++++++++++++ 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/Classes/LinphoneUI/UIRecordingCell.m b/Classes/LinphoneUI/UIRecordingCell.m index 534479e93..58475a8d2 100644 --- a/Classes/LinphoneUI/UIRecordingCell.m +++ b/Classes/LinphoneUI/UIRecordingCell.m @@ -84,21 +84,22 @@ static UILinphoneAudioPlayer *player; [self setFrame:frame]; } -- (void)setSelected:(BOOL)selected { +-(void)setSelected:(BOOL)selected animated:(BOOL)animated{ + [super setSelected:selected animated:animated]; if (!selected) return; if (!player) player = [UILinphoneAudioPlayer audioPlayerWithFilePath:[self recording]]; else [player setFile:[self recording]]; - - UILinphoneAudioPlayer *p = player; - [p.view removeFromSuperview]; - [self addSubview:p.view]; - [self bringSubviewToFront:p.view]; - p.view.frame = _playerView.frame; - p.view.bounds = _playerView.bounds; + if ([player isOpened]) + [player close]; + [player.view removeFromSuperview]; + [self addSubview:player.view]; + [self bringSubviewToFront:player.view]; + player.view.frame = _playerView.frame; + player.view.bounds = _playerView.bounds; + [player open]; } - @end diff --git a/Classes/Utils/Utils.h b/Classes/Utils/Utils.h index 1f03d9fb4..b3cca7947 100644 --- a/Classes/Utils/Utils.h +++ b/Classes/Utils/Utils.h @@ -62,6 +62,12 @@ typedef enum { @end +@interface UIImage (systemIcons) + ++ (UIImage *)imageFromSystemBarButton:(UIBarButtonSystemItem)systemItem :(UIColor *) color; + +@end + @interface NSString (linphoneExt) - (NSString *)md5; diff --git a/Classes/Utils/Utils.m b/Classes/Utils/Utils.m index 039f64248..c757eb4a2 100644 --- a/Classes/Utils/Utils.m +++ b/Classes/Utils/Utils.m @@ -569,6 +569,29 @@ @end +@implementation UIImage (systemIcons) + ++ (UIImage *)imageFromSystemBarButton:(UIBarButtonSystemItem)systemItem :(UIColor *) color { + // thanks to Renetik https://stackoverflow.com/a/49822488 + UIToolbar *bar = UIToolbar.new; + UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:systemItem target:nil action:nil]; + [bar setItems:@[buttonItem] animated:NO]; + [bar snapshotViewAfterScreenUpdates:YES]; + for (UIView *view in [(id) buttonItem view].subviews) + if ([view isKindOfClass:UIButton.class]) { + UIImage *image = [((UIButton *) view).imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + UIGraphicsBeginImageContextWithOptions(image.size, NO, image.scale); + //[color set]; + [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)]; + image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return image; + } + return nil; +} + +@end + @implementation NSString (md5) - (NSString *)md5 { From ade06f3f9522b09d9d7c9261c5ad1d6976cedfbb Mon Sep 17 00:00:00 2001 From: Benjamin Verdier Date: Thu, 26 Jul 2018 17:15:58 +0200 Subject: [PATCH 12/16] Add auto close of option menu and other record icon in call view --- Classes/Base.lproj/CallView.xib | 271 +++++++++++++++++--------------- Classes/CallView.h | 1 + Classes/CallView.m | 5 +- 3 files changed, 149 insertions(+), 128 deletions(-) diff --git a/Classes/Base.lproj/CallView.xib b/Classes/Base.lproj/CallView.xib index e43709a09..7dfbac661 100644 --- a/Classes/Base.lproj/CallView.xib +++ b/Classes/Base.lproj/CallView.xib @@ -1,6 +1,6 @@ - + @@ -43,6 +43,7 @@ + @@ -81,26 +82,26 @@ - + - + - + @@ -256,11 +265,11 @@