mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
refactor
This commit is contained in:
parent
7be2b14a01
commit
467c6f77cb
30 changed files with 236 additions and 245 deletions
|
|
@ -68,7 +68,7 @@
|
|||
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"],
|
||||
linphone_core_get_version()]];
|
||||
|
||||
if ([LinphoneManager runningOnIpad]) {
|
||||
if (LinphoneManager.runningOnIpad) {
|
||||
[LinphoneUtils adjustFontSize:self.view mult:2.22f];
|
||||
}
|
||||
|
||||
|
|
@ -93,12 +93,16 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:TabBarView.class
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
+ (void)removeBackground:(UIView *)view {
|
||||
|
|
|
|||
|
|
@ -68,13 +68,17 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
compositeDescription.darkBackground = true;
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
|
|
@ -98,7 +102,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
if ([LinphoneManager runningOnIpad]) {
|
||||
if (LinphoneManager.runningOnIpad) {
|
||||
[LinphoneUtils adjustFontSize:_welcomeView mult:2.22f];
|
||||
[LinphoneUtils adjustFontSize:_createAccountView mult:2.22f];
|
||||
[LinphoneUtils adjustFontSize:_linphoneLoginView mult:2.22f];
|
||||
|
|
@ -478,7 +482,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
switch (state) {
|
||||
case LinphoneRegistrationOk: {
|
||||
_waitView.hidden = true;
|
||||
[PhoneMainView.instance changeCurrentView:[DialerView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
|
||||
break;
|
||||
}
|
||||
case LinphoneRegistrationNone:
|
||||
|
|
@ -604,7 +608,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (IBAction)onDialerBackClick:(id)sender {
|
||||
[PhoneMainView.instance changeCurrentView:[DialerView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
|
||||
}
|
||||
|
||||
- (IBAction)onGotoCreateAccountClick:(id)sender {
|
||||
|
|
@ -689,7 +693,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
block:^{
|
||||
_waitView.hidden = true;
|
||||
[self addProxyConfig:username password:password domain:domain withTransport:transport];
|
||||
[PhoneMainView.instance changeCurrentView:[DialerView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
|
||||
}];
|
||||
[alert show];
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -67,13 +67,17 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
compositeDescription.darkBackground = true;
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - Event Functions
|
||||
|
||||
- (void)callUpdateEvent:(NSNotification *)notif {
|
||||
|
|
@ -92,7 +96,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (void)dismiss {
|
||||
if ([[PhoneMainView.instance currentView] equal:[CallIncomingView compositeViewDescription]]) {
|
||||
if ([[PhoneMainView.instance currentView] equal:CallIncomingView.compositeViewDescription]) {
|
||||
[PhoneMainView.instance popCurrentView];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,13 +32,17 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
compositeDescription.darkBackground = true;
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
|
|
|
|||
|
|
@ -85,6 +85,10 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
|
|
@ -272,7 +276,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
hideControlsTimer = nil;
|
||||
}
|
||||
|
||||
if ([[PhoneMainView.instance currentView] equal:[CallView compositeViewDescription]] && videoShown) {
|
||||
if ([[PhoneMainView.instance currentView] equal:CallView.compositeViewDescription] && videoShown) {
|
||||
// show controls
|
||||
[UIView beginAnimations:nil context:nil];
|
||||
[UIView setAnimationDuration:0.3];
|
||||
|
|
@ -297,7 +301,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
hideControlsTimer = nil;
|
||||
}
|
||||
|
||||
if ([[PhoneMainView.instance currentView] equal:[CallView compositeViewDescription]] && videoShown) {
|
||||
if ([[PhoneMainView.instance currentView] equal:CallView.compositeViewDescription] && videoShown) {
|
||||
[UIView beginAnimations:nil context:nil];
|
||||
[UIView setAnimationDuration:0.3];
|
||||
[videoCameraSwitch setAlpha:0.0];
|
||||
|
|
@ -483,7 +487,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
[timer invalidate];
|
||||
};
|
||||
[sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Decline", nil) block:cancelBlock];
|
||||
if ([LinphoneManager runningOnIpad]) {
|
||||
if (LinphoneManager.runningOnIpad) {
|
||||
[sheet addCancelButtonWithTitle:NSLocalizedString(@"Decline", nil) block:cancelBlock];
|
||||
}
|
||||
[sheet showInView:PhoneMainView.instance.view];
|
||||
|
|
|
|||
|
|
@ -80,6 +80,10 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
|
@ -481,7 +485,7 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
|
|||
|
||||
- (void)imagePickerDelegateImage:(UIImage *)image info:(NSDictionary *)info {
|
||||
// Dismiss popover on iPad
|
||||
if ([LinphoneManager runningOnIpad]) {
|
||||
if (LinphoneManager.runningOnIpad) {
|
||||
[VIEW(ImagePickerView).popoverController dismissPopoverAnimated:TRUE];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -138,8 +138,8 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:NO];
|
||||
LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)ms_list_nth_data(data, (int)[indexPath row]);
|
||||
ChatsListTableView *view = VIEW(ChatConversationView);
|
||||
[PhoneMainView.instance changeCurrentView:view push:TRUE];
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[view setChatRoom:chatRoom];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,12 +67,16 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:TabBarView.class
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - Action Functions
|
||||
|
||||
- (void)startChatRoom {
|
||||
|
|
@ -81,7 +85,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
linphone_core_get_chat_room_from_uri([LinphoneManager getLc], [addressField.text UTF8String]);
|
||||
if (room != nil) {
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE] [view setChatRoom:room];
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[view setChatRoom:room];
|
||||
} else {
|
||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid address", nil)
|
||||
message:@"Please specify the entire SIP address for the chat"
|
||||
|
|
@ -99,7 +104,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[ContactSelection setSipFilter:[LinphoneManager instance].contactFilter];
|
||||
[ContactSelection enableEmailFilter:FALSE];
|
||||
[ContactSelection setNameOrEmailFilter:nil];
|
||||
[PhoneMainView.instance changeCurrentView:[ContactsListView compositeViewDescription] push:TRUE];
|
||||
[PhoneMainView.instance changeCurrentView:ContactsListView.compositeViewDescription push:TRUE];
|
||||
} else {
|
||||
[self startChatRoom];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,16 +40,20 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:TabBarView.class
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)dismiss {
|
||||
if ([[PhoneMainView.instance currentView] equal:[ContactDetailsLabelView compositeViewDescription]]) {
|
||||
if ([[PhoneMainView.instance currentView] equal:ContactDetailsLabelView.compositeViewDescription]) {
|
||||
[PhoneMainView.instance popCurrentView];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
|
|||
if ([ContactSelection getSelectionMode] != ContactSelectionModeMessage) {
|
||||
// Go to dialer view
|
||||
DialerView *view = VIEW(DialerView);
|
||||
[PhoneMainView.instance changeCurrentView:view];
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
[view call:dest displayName:displayName];
|
||||
} else {
|
||||
// Go to Chat room view
|
||||
|
|
@ -639,14 +639,11 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
|
|||
}
|
||||
if (key != nil) {
|
||||
editingIndexPath = indexPath;
|
||||
ContactDetailsLabelView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[ContactDetailsLabelView compositeViewDescription] push:TRUE],
|
||||
ContactDetailsLabelView);
|
||||
if (controller != nil) {
|
||||
[controller setDataList:[self getLocalizedLabels]];
|
||||
[controller setSelectedData:key];
|
||||
[controller setDelegate:self];
|
||||
}
|
||||
ContactDetailsLabelView *view = VIEW(ContactDetailsLabelView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[view setDataList:[self getLocalizedLabels]];
|
||||
[view setSelectedData:key];
|
||||
[view setDelegate:self];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,12 +211,16 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:TabBarView.class
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)enableEdit:(BOOL)animated {
|
||||
|
|
|
|||
|
|
@ -230,15 +230,12 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
|
|||
ABRecordRef lPerson = (__bridge ABRecordRef)([subDic objectForKey:[subDic keyAtIndex:[indexPath row]]]);
|
||||
|
||||
// Go to Contact details view
|
||||
ContactDetailsView *controller =
|
||||
DYNAMIC_CAST([PhoneMainView.instance changeCurrentView:[ContactDetailsView compositeViewDescription] push:TRUE],
|
||||
ContactDetailsView);
|
||||
if (controller != nil) {
|
||||
if ([ContactSelection getSelectionMode] != ContactSelectionModeEdit) {
|
||||
[controller setContact:lPerson];
|
||||
} else {
|
||||
[controller editContact:lPerson address:[ContactSelection getAddAddress]];
|
||||
}
|
||||
ContactDetailsView *view = VIEW(ContactDetailsView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
if ([ContactSelection getSelectionMode] != ContactSelectionModeEdit) {
|
||||
[view setContact:lPerson];
|
||||
} else {
|
||||
[view editContact:lPerson address:[ContactSelection getAddAddress]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,12 +106,16 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:TabBarView.class
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
|
|
@ -157,7 +161,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
|
||||
otherButtonTitles:nil];
|
||||
[error show];
|
||||
[PhoneMainView.instance changeCurrentView:[DialerView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -234,15 +238,12 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (IBAction)onAddContactClick:(id)event {
|
||||
// Go to Contact details view
|
||||
ContactDetailsView *controller =
|
||||
DYNAMIC_CAST([PhoneMainView.instance changeCurrentView:[ContactDetailsView compositeViewDescription] push:TRUE],
|
||||
ContactDetailsView);
|
||||
if (controller != nil) {
|
||||
if ([ContactSelection getAddAddress] == nil) {
|
||||
[controller newContact];
|
||||
} else {
|
||||
[controller newContact:[ContactSelection getAddAddress]];
|
||||
}
|
||||
ContactDetailsView *view = VIEW(ContactDetailsView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
if ([ContactSelection getAddAddress] == nil) {
|
||||
[view newContact];
|
||||
} else {
|
||||
[view newContact:[ContactSelection getAddAddress]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -284,11 +285,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
CFIndex valueIdx = ABMultiValueGetIndexForIdentifier(multiValue, identifier);
|
||||
NSString *phoneNumber = (NSString *)CFBridgingRelease(ABMultiValueCopyValueAtIndex(multiValue, valueIdx));
|
||||
// Go to dialer view
|
||||
DialerView *controller =
|
||||
DYNAMIC_CAST([PhoneMainView.instance changeCurrentView:[DialerView compositeViewDescription]], DialerView);
|
||||
if (controller != nil) {
|
||||
[controller call:phoneNumber displayName:(NSString *)CFBridgingRelease(ABRecordCopyCompositeName(person))];
|
||||
}
|
||||
DialerView *view = VIEW(DialerView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
[view call:phoneNumber displayName:(NSString *)CFBridgingRelease(ABRecordCopyCompositeName(person))];
|
||||
CFRelease(multiValue);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,13 +78,17 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:TabBarView.class
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
compositeDescription.darkBackground = true;
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
|
|
@ -114,7 +118,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
LinphoneCallState state = (call != NULL) ? linphone_call_get_state(call) : 0;
|
||||
[self callUpdate:call state:state];
|
||||
|
||||
if ([LinphoneManager runningOnIpad]) {
|
||||
if (LinphoneManager.runningOnIpad) {
|
||||
BOOL videoEnabled = linphone_core_video_enabled(lc);
|
||||
BOOL previewPref = [mgr lpConfigBoolForKey:@"preview_preference"];
|
||||
|
||||
|
|
@ -172,7 +176,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(onOneLongClick:)];
|
||||
[oneButton addGestureRecognizer:oneLongGesture];
|
||||
|
||||
if ([LinphoneManager runningOnIpad]) {
|
||||
if (LinphoneManager.runningOnIpad) {
|
||||
if ([LinphoneManager instance].frontCamId != nil) {
|
||||
// only show camera switch button if we have more than 1 camera
|
||||
[videoCameraSwitch setHidden:FALSE];
|
||||
|
|
@ -216,7 +220,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (void)coreUpdateEvent:(NSNotification *)notif {
|
||||
if ([LinphoneManager runningOnIpad]) {
|
||||
if (LinphoneManager.runningOnIpad) {
|
||||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
if (linphone_core_video_enabled(lc) && linphone_core_video_preview_enabled(lc)) {
|
||||
linphone_core_set_native_preview_window_id(lc, (__bridge void *)(videoPreview));
|
||||
|
|
@ -399,11 +403,11 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[ContactSelection setNameOrEmailFilter:nil];
|
||||
[ContactSelection enableEmailFilter:FALSE];
|
||||
ContactsListView *view = VIEW(ContactsListView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[PhoneMainView.instance changeCurrentView:view.class.compositeViewDescription push:TRUE];
|
||||
}
|
||||
|
||||
- (IBAction)onBackClick:(id)event {
|
||||
[PhoneMainView.instance changeCurrentView:[CallView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription];
|
||||
}
|
||||
|
||||
- (IBAction)onAddressChange:(id)sender {
|
||||
|
|
|
|||
|
|
@ -52,12 +52,16 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:TabBarView.class
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - Property Functions
|
||||
|
||||
- (void)setCallLogId:(NSString *)acallLogId {
|
||||
|
|
@ -174,13 +178,10 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (IBAction)onContactClick:(id)event {
|
||||
if (contact) {
|
||||
ContactDetailsView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[ContactDetailsView compositeViewDescription] push:TRUE],
|
||||
ContactDetailsView);
|
||||
if (controller != nil) {
|
||||
[ContactSelection setSelectionMode:ContactSelectionModeNone];
|
||||
[controller setContact:contact];
|
||||
}
|
||||
ContactDetailsView *view = VIEW(ContactDetailsView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[ContactSelection setSelectionMode:ContactSelectionModeNone];
|
||||
[view setContact:contact];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -197,9 +198,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[ContactSelection setSipFilter:nil];
|
||||
[ContactSelection enableEmailFilter:FALSE];
|
||||
[ContactSelection setNameOrEmailFilter:nil];
|
||||
DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[ContactsListView compositeViewDescription] push:TRUE],
|
||||
ContactsListView);
|
||||
[PhoneMainView.instance changeCurrentView:ContactsListView.compositeViewDescription push:TRUE];
|
||||
ms_free(lAddress);
|
||||
}
|
||||
}
|
||||
|
|
@ -212,11 +211,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
return;
|
||||
NSString *displayName = [FastAddressBook displayNameForAddress:addr];
|
||||
|
||||
DialerView *controller =
|
||||
DYNAMIC_CAST([PhoneMainView.instance changeCurrentView:[DialerView compositeViewDescription]], DialerView);
|
||||
if (controller != nil) {
|
||||
[controller call:[NSString stringWithUTF8String:lAddress] displayName:displayName];
|
||||
}
|
||||
DialerView *view = VIEW(DialerView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
[view call:[NSString stringWithUTF8String:lAddress] displayName:displayName];
|
||||
ms_free(lAddress);
|
||||
}
|
||||
|
||||
|
|
@ -224,15 +221,11 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
const LinphoneAddress *addr = linphone_call_log_get_remote_address(callLog);
|
||||
if (addr == NULL)
|
||||
return;
|
||||
// Go to ChatRoom view
|
||||
[PhoneMainView.instance changeCurrentView:[ChatsListView compositeViewDescription]];
|
||||
ChatConversationView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[ChatConversationView compositeViewDescription] push:TRUE],
|
||||
ChatConversationView);
|
||||
if (controller != nil) {
|
||||
LinphoneChatRoom *room = linphone_core_get_chat_room([LinphoneManager getLc], addr);
|
||||
[controller setChatRoom:room];
|
||||
}
|
||||
[PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription];
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
LinphoneChatRoom *room = linphone_core_get_chat_room([LinphoneManager getLc], addr);
|
||||
[view setChatRoom:room];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -143,14 +143,9 @@
|
|||
if (callLog != NULL && linphone_call_log_get_call_id(callLog) != NULL) {
|
||||
LinphoneAddress *addr = linphone_call_log_get_remote_address(callLog);
|
||||
char *uri = linphone_address_as_string(addr);
|
||||
|
||||
// Go to dialer view
|
||||
DialerView *controller =
|
||||
DYNAMIC_CAST([PhoneMainView.instance changeCurrentView:[DialerView compositeViewDescription]], DialerView);
|
||||
if (controller != nil) {
|
||||
[controller call:[NSString stringWithUTF8String:uri]
|
||||
displayName:[FastAddressBook displayNameForAddress:addr]];
|
||||
}
|
||||
DialerView *view = VIEW(DialerView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
[view call:[NSString stringWithUTF8String:uri] displayName:[FastAddressBook displayNameForAddress:addr]];
|
||||
ms_free(uri);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,12 +48,16 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:TabBarView.class
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
self = [super init];
|
||||
if (self != nil) {
|
||||
pickerController = [[UIImagePickerController alloc] init];
|
||||
if ([LinphoneManager runningOnIpad]) {
|
||||
if (LinphoneManager.runningOnIpad) {
|
||||
popoverController = [[UIPopoverController alloc] initWithContentViewController:pickerController];
|
||||
}
|
||||
}
|
||||
|
|
@ -53,13 +53,17 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
compositeDescription.darkBackground = false;
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
|
@ -124,7 +128,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
#pragma mark -
|
||||
|
||||
- (void)dismiss {
|
||||
if ([[PhoneMainView.instance currentView] equal:[ImagePickerView compositeViewDescription]]) {
|
||||
if ([[PhoneMainView.instance currentView] equal:ImagePickerView.compositeViewDescription]) {
|
||||
[PhoneMainView.instance popCurrentView];
|
||||
}
|
||||
}
|
||||
|
|
@ -164,34 +168,28 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
+ (void)SelectImageFromDevice:(id<ImagePickerDelegate>)delegate
|
||||
atPosition:(CGRect)ipadPopoverPosition
|
||||
inView:(UIView *)view {
|
||||
inView:(UIView *)ipadView {
|
||||
void (^block)(UIImagePickerControllerSourceType) = ^(UIImagePickerControllerSourceType type) {
|
||||
UICompositeViewDescription *description = [ImagePickerView compositeViewDescription];
|
||||
ImagePickerView *controller;
|
||||
if ([LinphoneManager runningOnIpad] && view) {
|
||||
controller = DYNAMIC_CAST([PhoneMainView.instance.mainViewController getCachedController:description.content],
|
||||
ImagePickerView);
|
||||
} else {
|
||||
controller = DYNAMIC_CAST([PhoneMainView.instance changeCurrentView:description push:TRUE], ImagePickerView);
|
||||
ImagePickerView *view = VIEW(ImagePickerView);
|
||||
if (!LinphoneManager.runningOnIpad) {
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
}
|
||||
if (controller != nil) {
|
||||
controller.sourceType = type;
|
||||
view.sourceType = type;
|
||||
|
||||
// Displays a control that allows the user to choose picture or
|
||||
// movie capture, if both are available:
|
||||
controller.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage];
|
||||
// Displays a control that allows the user to choose picture or
|
||||
// movie capture, if both are available:
|
||||
view.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage];
|
||||
|
||||
// Hides the controls for moving & scaling pictures, or for
|
||||
// trimming movies. To instead show the controls, use YES.
|
||||
controller.allowsEditing = NO;
|
||||
controller.imagePickerDelegate = delegate;
|
||||
// Hides the controls for moving & scaling pictures, or for
|
||||
// trimming movies. To instead show the controls, use YES.
|
||||
view.allowsEditing = NO;
|
||||
view.imagePickerDelegate = delegate;
|
||||
|
||||
if ([LinphoneManager runningOnIpad] && view) {
|
||||
[controller.popoverController presentPopoverFromRect:ipadPopoverPosition
|
||||
inView:view
|
||||
permittedArrowDirections:UIPopoverArrowDirectionAny
|
||||
animated:FALSE];
|
||||
}
|
||||
if (LinphoneManager.runningOnIpad) {
|
||||
[view.popoverController presentPopoverFromRect:ipadPopoverPosition
|
||||
inView:ipadView
|
||||
permittedArrowDirections:UIPopoverArrowDirectionAny
|
||||
animated:FALSE];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -128,12 +128,16 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - Property Functions
|
||||
|
||||
- (void)setImage:(UIImage *)aimage {
|
||||
|
|
@ -147,7 +151,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
#pragma mark - Action Functions
|
||||
|
||||
- (IBAction)onBackClick:(id)sender {
|
||||
if ([[PhoneMainView.instance currentView] equal:[ImageView compositeViewDescription]]) {
|
||||
if ([[PhoneMainView.instance currentView] equal:ImageView.compositeViewDescription]) {
|
||||
[PhoneMainView.instance popCurrentView];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -251,12 +251,7 @@
|
|||
// trailing "/"
|
||||
NSString *sipUri = [[url resourceSpecifier]
|
||||
stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
|
||||
|
||||
DialerView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[DialerView compositeViewDescription]], DialerView);
|
||||
if (controller != nil) {
|
||||
[controller setAddress:sipUri];
|
||||
}
|
||||
[VIEW(DialerView) setAddress:sipUri];
|
||||
}
|
||||
}
|
||||
return YES;
|
||||
|
|
@ -297,7 +292,7 @@
|
|||
|
||||
if ([loc_key isEqualToString:@"IM_MSG"]) {
|
||||
|
||||
[PhoneMainView.instance changeCurrentView:[ChatsListView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription];
|
||||
|
||||
} else if ([loc_key isEqualToString:@"IC_MSG"]) {
|
||||
|
||||
|
|
@ -336,7 +331,6 @@
|
|||
|
||||
if ([notification.userInfo objectForKey:@"callId"] != nil) {
|
||||
BOOL auto_answer = TRUE;
|
||||
|
||||
// some local notifications have an internal timer to relaunch themselves at specified intervals
|
||||
if ([[notification.userInfo objectForKey:@"timer"] intValue] == 1) {
|
||||
[[LinphoneManager instance] cancelLocalNotifTimerForCallId:[notification.userInfo objectForKey:@"callId"]];
|
||||
|
|
@ -347,25 +341,14 @@
|
|||
}
|
||||
} else if ([notification.userInfo objectForKey:@"from_addr"] != nil) {
|
||||
NSString *remoteContact = (NSString *)[notification.userInfo objectForKey:@"from_addr"];
|
||||
// Go to ChatRoom view
|
||||
[PhoneMainView.instance changeCurrentView:[ChatsListView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription];
|
||||
LinphoneChatRoom *room = [self findChatRoomForContact:remoteContact];
|
||||
ChatConversationView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[ChatConversationView compositeViewDescription] push:TRUE],
|
||||
ChatConversationView);
|
||||
if (controller != nil && room != nil) {
|
||||
[controller setChatRoom:room];
|
||||
}
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE], [view setChatRoom:room];
|
||||
} else if ([notification.userInfo objectForKey:@"callLog"] != nil) {
|
||||
NSString *callLog = (NSString *)[notification.userInfo objectForKey:@"callLog"];
|
||||
// Go to HistoryDetails view
|
||||
[PhoneMainView.instance changeCurrentView:[HistoryListView compositeViewDescription]];
|
||||
HistoryDetailsView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[HistoryDetailsView compositeViewDescription] push:TRUE],
|
||||
HistoryDetailsView);
|
||||
if (controller != nil) {
|
||||
[controller setCallLogId:callLog];
|
||||
}
|
||||
HistoryDetailsView *view = VIEW(HistoryDetailsView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE], [view setCallLogId:callLog];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1649,7 +1649,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
linphone_core_start_dtmf_stream(theLinphoneCore);
|
||||
|
||||
/*start the video preview in case we are in the main view*/
|
||||
if ([LinphoneManager runningOnIpad] && linphone_core_video_enabled(theLinphoneCore) &&
|
||||
if (LinphoneManager.runningOnIpad && linphone_core_video_enabled(theLinphoneCore) &&
|
||||
[self lpConfigBoolForKey:@"preview_preference"]) {
|
||||
linphone_core_enable_video_preview(theLinphoneCore, TRUE);
|
||||
}
|
||||
|
|
@ -1707,7 +1707,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
- (void)copyDefaultSettings {
|
||||
NSString *src = [LinphoneManager bundleFile:@"linphonerc"];
|
||||
NSString *srcIpad = [LinphoneManager bundleFile:@"linphonerc~ipad"];
|
||||
if ([LinphoneManager runningOnIpad] && [[NSFileManager defaultManager] fileExistsAtPath:srcIpad]) {
|
||||
if (LinphoneManager.runningOnIpad && [[NSFileManager defaultManager] fileExistsAtPath:srcIpad]) {
|
||||
src = srcIpad;
|
||||
}
|
||||
NSString *dst = [LinphoneManager documentFile:@"linphonerc"];
|
||||
|
|
@ -1717,7 +1717,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
- (void)overrideDefaultSettings {
|
||||
NSString *factory = [LinphoneManager bundleFile:@"linphonerc-factory"];
|
||||
NSString *factoryIpad = [LinphoneManager bundleFile:@"linphonerc-factory~ipad"];
|
||||
if ([LinphoneManager runningOnIpad] && [[NSFileManager defaultManager] fileExistsAtPath:factoryIpad]) {
|
||||
if (LinphoneManager.runningOnIpad && [[NSFileManager defaultManager] fileExistsAtPath:factoryIpad]) {
|
||||
factory = factoryIpad;
|
||||
}
|
||||
NSString *confiFileName = [LinphoneManager documentFile:@"linphonerc"];
|
||||
|
|
@ -1735,7 +1735,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
NSString *route = (__bridge NSString *)lNewRoute;
|
||||
notallow = [route isEqualToString:@"Headset"] || [route isEqualToString:@"Headphone"] ||
|
||||
[route isEqualToString:@"HeadphonesAndMicrophone"] || [route isEqualToString:@"HeadsetInOut"] ||
|
||||
[route isEqualToString:@"Lineout"] || [LinphoneManager runningOnIpad];
|
||||
[route isEqualToString:@"Lineout"] || LinphoneManager.runningOnIpad;
|
||||
CFRelease(lNewRoute);
|
||||
}
|
||||
return !notallow;
|
||||
|
|
@ -1759,7 +1759,7 @@ static void audioRouteChangeListenerCallback(void *inUserData, // 1
|
|||
LOGI(@"Current audio route is [%s]", [route cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
|
||||
speakerEnabled = [route isEqualToString:@"Speaker"] || [route isEqualToString:@"SpeakerAndMicrophone"];
|
||||
if (![LinphoneManager runningOnIpad] && [route isEqualToString:@"HeadsetBT"] && !speakerEnabled) {
|
||||
if (!LinphoneManager.runningOnIpad && [route isEqualToString:@"HeadsetBT"] && !speakerEnabled) {
|
||||
lm.bluetoothEnabled = TRUE;
|
||||
lm.bluetoothAvailable = TRUE;
|
||||
NSDictionary *dict = [NSDictionary
|
||||
|
|
|
|||
|
|
@ -218,10 +218,10 @@ static NSString *const kDisappearAnimation = @"disappear";
|
|||
}
|
||||
|
||||
- (void)updateSelectedButton:(UICompositeViewDescription *)view {
|
||||
historyButton.selected = [view equal:[HistoryListView compositeViewDescription]];
|
||||
contactsButton.selected = [view equal:[ContactsListView compositeViewDescription]];
|
||||
dialerButton.selected = [view equal:[DialerView compositeViewDescription]];
|
||||
chatButton.selected = [view equal:[ChatsListView compositeViewDescription]];
|
||||
historyButton.selected = [view equal:HistoryListView.compositeViewDescription];
|
||||
contactsButton.selected = [view equal:ContactsListView.compositeViewDescription];
|
||||
dialerButton.selected = [view equal:DialerView.compositeViewDescription];
|
||||
chatButton.selected = [view equal:ChatsListView.compositeViewDescription];
|
||||
CGRect selectedNewFrame = _selectedBtnView.frame;
|
||||
selectedNewFrame.origin.x =
|
||||
(historyButton.selected
|
||||
|
|
@ -236,7 +236,7 @@ static NSString *const kDisappearAnimation = @"disappear";
|
|||
#pragma mark - Action Functions
|
||||
|
||||
- (IBAction)onHistoryClick:(id)event {
|
||||
[PhoneMainView.instance changeCurrentView:[HistoryListView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:HistoryListView.compositeViewDescription];
|
||||
}
|
||||
|
||||
- (IBAction)onContactsClick:(id)event {
|
||||
|
|
@ -245,19 +245,19 @@ static NSString *const kDisappearAnimation = @"disappear";
|
|||
[ContactSelection setSipFilter:nil];
|
||||
[ContactSelection enableEmailFilter:FALSE];
|
||||
[ContactSelection setNameOrEmailFilter:nil];
|
||||
[PhoneMainView.instance changeCurrentView:[ContactsListView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:ContactsListView.compositeViewDescription];
|
||||
}
|
||||
|
||||
- (IBAction)onDialerClick:(id)event {
|
||||
[PhoneMainView.instance changeCurrentView:[DialerView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
|
||||
}
|
||||
|
||||
- (IBAction)onSettingsClick:(id)event {
|
||||
[PhoneMainView.instance changeCurrentView:[SettingsView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:SettingsView.compositeViewDescription];
|
||||
}
|
||||
|
||||
- (IBAction)onChatClick:(id)event {
|
||||
[PhoneMainView.instance changeCurrentView:[ChatsListView compositeViewDescription]];
|
||||
[PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription];
|
||||
}
|
||||
|
||||
#pragma mark - Animation
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@
|
|||
[UICallCell adaptSize:videoUploadBandwidthHeaderLabel field:videoUploadBandwidthLabel];
|
||||
[UICallCell adaptSize:videoIceConnectivityHeaderLabel field:videoIceConnectivityLabel];
|
||||
|
||||
if ([LinphoneManager runningOnIpad]) {
|
||||
if (LinphoneManager.runningOnIpad) {
|
||||
[LinphoneUtils adjustFontSize:self.audioStatsView mult:2.22];
|
||||
[LinphoneUtils adjustFontSize:self.videoStatsView mult:2.22];
|
||||
}
|
||||
|
|
@ -200,11 +200,11 @@
|
|||
#pragma mark - Static Functions
|
||||
|
||||
+ (int)getMaximizedHeight {
|
||||
return [LinphoneManager runningOnIpad] ? 600 : 300;
|
||||
return LinphoneManager.runningOnIpad ? 600 : 300;
|
||||
}
|
||||
|
||||
+ (int)getMinimizedHeight {
|
||||
return [LinphoneManager runningOnIpad] ? 126 : 63;
|
||||
return LinphoneManager.runningOnIpad ? 126 : 63;
|
||||
}
|
||||
|
||||
+ (void)adaptSize:(UILabel *)label field:(UIView *)field {
|
||||
|
|
|
|||
|
|
@ -391,13 +391,11 @@ static UIFont *CELL_FONT = nil;
|
|||
[self onResendClick:nil];
|
||||
} else {
|
||||
if (![messageImageView isLoading]) {
|
||||
ImageView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[ImageView compositeViewDescription] push:TRUE], ImageView);
|
||||
if (controller != nil) {
|
||||
CGImageRef fullScreenRef = [[messageImageView.fullImageUrl defaultRepresentation] fullScreenImage];
|
||||
UIImage *fullScreen = [UIImage imageWithCGImage:fullScreenRef];
|
||||
[controller setImage:fullScreen];
|
||||
}
|
||||
ImageView *view = VIEW(ImageView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
CGImageRef fullScreenRef = [[messageImageView.fullImageUrl defaultRepresentation] fullScreenImage];
|
||||
UIImage *fullScreen = [UIImage imageWithCGImage:fullScreenRef];
|
||||
[view setImage:fullScreen];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -453,7 +451,7 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
|
|||
// message, so we must refresh the table when we change to this state to ensure that
|
||||
// all transient messages apppear
|
||||
// ChatRoomViewController *controller = DYNAMIC_CAST(
|
||||
// [PhoneMainView.instance changeCurrentView:[ChatRoomViewController compositeViewDescription]
|
||||
// [PhoneMainView.instance changeCurrentView:ChatRoomViewController.compositeViewDescription
|
||||
// push:TRUE],
|
||||
// ChatRoomViewController);
|
||||
// [controller.tableController setChatRoom:linphone_chat_message_get_chat_room(msg)];
|
||||
|
|
|
|||
|
|
@ -334,13 +334,11 @@ static UIFont *CELL_FONT = nil;
|
|||
[self onResendClick:event];
|
||||
} else {
|
||||
if (![_messageImageView isLoading]) {
|
||||
ImageView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[ImageView compositeViewDescription] push:TRUE], ImageView);
|
||||
if (controller != nil) {
|
||||
CGImageRef fullScreenRef = [[_messageImageView.fullImageUrl defaultRepresentation] fullScreenImage];
|
||||
UIImage *fullScreen = [UIImage imageWithCGImage:fullScreenRef];
|
||||
[controller setImage:fullScreen];
|
||||
}
|
||||
ImageView *view = VIEW(ImageView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
CGImageRef fullScreenRef = [[_messageImageView.fullImageUrl defaultRepresentation] fullScreenImage];
|
||||
UIImage *fullScreen = [UIImage imageWithCGImage:fullScreenRef];
|
||||
[view setImage:fullScreen];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -393,7 +391,7 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
|
|||
// message, so we must refresh the table when we change to this state to ensure that
|
||||
// all transient messages apppear
|
||||
// ChatRoomViewController *controller = DYNAMIC_CAST(
|
||||
// [PhoneMainView.instance changeCurrentView:[ChatRoomViewController compositeViewDescription]
|
||||
// [PhoneMainView.instance changeCurrentView:ChatRoomViewController.compositeViewDescription
|
||||
// push:TRUE],
|
||||
// ChatRoomViewController);
|
||||
// [controller.tableController setChatRoom:linphone_chat_message_get_chat_room(msg)];
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
@protocol UICompositeViewDelegate <NSObject>
|
||||
|
||||
+ (UICompositeViewDescription *)compositeViewDescription;
|
||||
- (UICompositeViewDescription *)compositeViewDescription;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,12 +55,9 @@
|
|||
- (IBAction)onDetails:(id)event {
|
||||
if (callLog != NULL && linphone_call_log_get_call_id(callLog) != NULL) {
|
||||
// Go to History details view
|
||||
HistoryDetailsView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[HistoryDetailsView compositeViewDescription] push:TRUE],
|
||||
HistoryDetailsView);
|
||||
if (controller != nil) {
|
||||
[controller setCallLogId:[NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)]];
|
||||
}
|
||||
HistoryDetailsView *view = VIEW(HistoryDetailsView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[view setCallLogId:[NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
- (void)addDoneButton {
|
||||
// actually on iPad there is a done button
|
||||
if (![LinphoneManager runningOnIpad]) {
|
||||
if (!LinphoneManager.runningOnIpad) {
|
||||
UIToolbar *numberToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
|
||||
numberToolbar.items = [NSArray
|
||||
arrayWithObjects:[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel", nil)
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
- (PhoneMainView *)setViewControllerForDescription:(UICompositeViewDescription *)description {
|
||||
PhoneMainView *newMainView = description.landscapeMode ? self.rotatingViewController : self.portraitViewController;
|
||||
|
||||
if ([LinphoneManager runningOnIpad])
|
||||
if (LinphoneManager.runningOnIpad)
|
||||
return currentViewController;
|
||||
|
||||
if (newMainView != currentViewController) {
|
||||
|
|
@ -225,7 +225,7 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
}
|
||||
|
||||
- (NSUInteger)supportedInterfaceOrientations {
|
||||
if ([LinphoneManager runningOnIpad] || [mainViewController currentViewSupportsLandscape])
|
||||
if (LinphoneManager.runningOnIpad || [mainViewController currentViewSupportsLandscape])
|
||||
return UIInterfaceOrientationMaskAll;
|
||||
else {
|
||||
return UIInterfaceOrientationMaskPortrait;
|
||||
|
|
@ -295,11 +295,9 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
linphone_core_get_default_proxy([LinphoneManager getLc], &conf);
|
||||
if ([[LinphoneManager instance] lpConfigBoolForKey:@"show_login_view" forSection:@"app"] && conf == NULL) {
|
||||
already_shown = TRUE;
|
||||
AssistantView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[AssistantView compositeViewDescription]], AssistantView);
|
||||
if (controller != nil) {
|
||||
[controller fillDefaultValues];
|
||||
}
|
||||
AssistantView *view = VIEW(AssistantView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
[view fillDefaultValues];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -312,7 +310,7 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
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 &&
|
||||
if ([[self currentView] equal:CallIncomingView.compositeViewDescription] && state != LinphoneCallError &&
|
||||
state != LinphoneCallEnd) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -324,13 +322,13 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
break;
|
||||
}
|
||||
case LinphoneCallOutgoingInit: {
|
||||
[self changeCurrentView:[CallOutgoingView compositeViewDescription]];
|
||||
[self changeCurrentView:CallOutgoingView.compositeViewDescription];
|
||||
break;
|
||||
}
|
||||
case LinphoneCallPausedByRemote:
|
||||
case LinphoneCallConnected:
|
||||
case LinphoneCallStreamsRunning: {
|
||||
[self changeCurrentView:[CallView compositeViewDescription]];
|
||||
[self changeCurrentView:CallView.compositeViewDescription];
|
||||
break;
|
||||
}
|
||||
case LinphoneCallUpdatedByRemote: {
|
||||
|
|
@ -338,7 +336,7 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
const LinphoneCallParams *remote = linphone_call_get_remote_params(call);
|
||||
|
||||
if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) {
|
||||
[self changeCurrentView:[CallView compositeViewDescription]];
|
||||
[self changeCurrentView:CallView.compositeViewDescription];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -348,14 +346,12 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
case LinphoneCallEnd: {
|
||||
if (canHideInCallView) {
|
||||
// Go to dialer view
|
||||
DialerView *controller =
|
||||
DYNAMIC_CAST([self changeCurrentView:[DialerView compositeViewDescription]], DialerView);
|
||||
if (controller != nil) {
|
||||
[controller setAddress:@""];
|
||||
[controller setTransferMode:FALSE];
|
||||
}
|
||||
DialerView *view = VIEW(DialerView);
|
||||
[self changeCurrentView:view.compositeViewDescription];
|
||||
[view setAddress:@""];
|
||||
[view setTransferMode:FALSE];
|
||||
} else {
|
||||
[self changeCurrentView:[CallView compositeViewDescription]];
|
||||
[self changeCurrentView:CallView.compositeViewDescription];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -412,7 +408,7 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
core = [LinphoneManager getLc];
|
||||
LinphoneManager *lm = [LinphoneManager instance];
|
||||
if (linphone_core_get_global_state(core) != LinphoneGlobalOn) {
|
||||
[self changeCurrentView:[DialerView compositeViewDescription]];
|
||||
[self changeCurrentView:DialerView.compositeViewDescription];
|
||||
} else if ([[LinphoneManager instance] lpConfigBoolForKey:@"enable_first_login_view_preference"] == true) {
|
||||
// TODO: Change to fist login view
|
||||
} else {
|
||||
|
|
@ -420,13 +416,11 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
// Change to default view
|
||||
const MSList *list = linphone_core_get_proxy_config_list(core);
|
||||
if (list != NULL || ([lm lpConfigBoolForKey:@"hide_assistant_preference"] == true) || lm.isTesting) {
|
||||
[self changeCurrentView:[DialerView compositeViewDescription]];
|
||||
[self changeCurrentView:DialerView.compositeViewDescription];
|
||||
} else {
|
||||
AssistantView *controller = DYNAMIC_CAST(
|
||||
[PhoneMainView.instance changeCurrentView:[AssistantView compositeViewDescription]], AssistantView);
|
||||
if (controller != nil) {
|
||||
[controller reset];
|
||||
}
|
||||
AssistantView *view = VIEW(AssistantView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
[view reset];
|
||||
}
|
||||
}
|
||||
[self updateApplicationBadgeNumber]; // Update Badge at startup
|
||||
|
|
@ -470,26 +464,24 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
+ (CATransition *)getTransition:(UICompositeViewDescription *)old new:(UICompositeViewDescription *) new {
|
||||
bool left = false;
|
||||
|
||||
if ([old equal:[ChatsListView compositeViewDescription]]) {
|
||||
if ([new equal:[ContactsListView compositeViewDescription]] ||
|
||||
[new equal:[DialerView compositeViewDescription]] ||
|
||||
[new equal:[HistoryListView compositeViewDescription]]) {
|
||||
if ([old equal:ChatsListView.compositeViewDescription]) {
|
||||
if ([new equal:ContactsListView.compositeViewDescription] || [new equal:DialerView.compositeViewDescription] ||
|
||||
[new equal:HistoryListView.compositeViewDescription]) {
|
||||
left = true;
|
||||
}
|
||||
} else if ([old equal:[SettingsView compositeViewDescription]]) {
|
||||
if ([new equal:[DialerView compositeViewDescription]] ||
|
||||
[new equal:[ContactsListView compositeViewDescription]] ||
|
||||
[new equal:[HistoryListView compositeViewDescription]] ||
|
||||
[new equal:[ChatsListView compositeViewDescription]]) {
|
||||
} else if ([old equal:SettingsView.compositeViewDescription]) {
|
||||
if ([new equal:DialerView.compositeViewDescription] || [new equal:ContactsListView.compositeViewDescription] ||
|
||||
[new equal:HistoryListView.compositeViewDescription] ||
|
||||
[new equal:ChatsListView.compositeViewDescription]) {
|
||||
left = true;
|
||||
}
|
||||
} else if ([old equal:[DialerView compositeViewDescription]]) {
|
||||
if ([new equal:[ContactsListView compositeViewDescription]] ||
|
||||
[new equal:[HistoryListView compositeViewDescription]]) {
|
||||
} else if ([old equal:DialerView.compositeViewDescription]) {
|
||||
if ([new equal:ContactsListView.compositeViewDescription] ||
|
||||
[new equal:HistoryListView.compositeViewDescription]) {
|
||||
left = true;
|
||||
}
|
||||
} else if ([old equal:[ContactsListView compositeViewDescription]]) {
|
||||
if ([new equal:[HistoryListView compositeViewDescription]]) {
|
||||
} else if ([old equal:ContactsListView.compositeViewDescription]) {
|
||||
if ([new equal:HistoryListView.compositeViewDescription]) {
|
||||
left = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -700,22 +692,12 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
if (callIDFromPush && autoAnswer) {
|
||||
// accept call automatically
|
||||
[lm acceptCall:call];
|
||||
|
||||
} else {
|
||||
|
||||
CallIncomingView *controller = nil;
|
||||
if (![currentView.content isEqualToString:[CallIncomingView compositeViewDescription].content]) {
|
||||
controller = DYNAMIC_CAST(
|
||||
[self changeCurrentView:[CallIncomingView compositeViewDescription] push:TRUE], CallIncomingView);
|
||||
} else {
|
||||
// controller is already presented, don't bother animating a transition
|
||||
controller = DYNAMIC_CAST([self.mainViewController getCurrentViewController], CallIncomingView);
|
||||
}
|
||||
AudioServicesPlaySystemSound(lm.sounds.vibrate);
|
||||
if (controller != nil) {
|
||||
[controller setCall:call];
|
||||
[controller setDelegate:self];
|
||||
}
|
||||
CallIncomingView *view = VIEW(CallIncomingView);
|
||||
[self changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[view setCall:call];
|
||||
[view setDelegate:self];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@
|
|||
}
|
||||
|
||||
- (IBAction)onAboutClick:(id)sender {
|
||||
[PhoneMainView.instance changeCurrentView:[AboutView compositeViewDescription] push:TRUE];
|
||||
[PhoneMainView.instance changeCurrentView:AboutView.compositeViewDescription push:TRUE];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -397,12 +397,16 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
stateBar:StatusBarView.class
|
||||
tabBar:TabBarView.class
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
landscapeMode:LinphoneManager.runningOnIpad
|
||||
portraitMode:true];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
- (UICompositeViewDescription *)compositeViewDescription {
|
||||
return self.class.compositeViewDescription;
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
|
@ -646,7 +650,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[hiddenKeys addObject:@"console_button"];
|
||||
}
|
||||
|
||||
if (![LinphoneManager runningOnIpad]) {
|
||||
if (!LinphoneManager.runningOnIpad) {
|
||||
[hiddenKeys addObject:@"preview_preference"];
|
||||
}
|
||||
if ([lm lpConfigBoolForKey:@"hide_run_assistant_preference"]) {
|
||||
|
|
@ -723,7 +727,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[alert show];
|
||||
|
||||
} else if ([key isEqual:@"about_button"]) {
|
||||
[PhoneMainView.instance changeCurrentView:[AboutView compositeViewDescription] push:TRUE];
|
||||
[PhoneMainView.instance changeCurrentView:AboutView.compositeViewDescription push:TRUE];
|
||||
} else if ([key isEqualToString:@"reset_logs_button"]) {
|
||||
linphone_core_reset_log_collection();
|
||||
} else if ([key isEqual:@"send_logs_button"]) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue