UI: fix fragments on phone

This commit is contained in:
Gautier Pelloux-Prayer 2015-12-18 15:53:30 +01:00
parent 0567231d58
commit 87bd9fac7b
3 changed files with 17 additions and 10 deletions

View file

@ -221,12 +221,18 @@
id log = [_sections objectForKey:_sortedDays[indexPath.section]][indexPath.row];
LinphoneCallLog *callLog = [log pointerValue];
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);
DialerView *view = VIEW(DialerView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[view call:[NSString stringWithUTF8String:uri] displayName:[FastAddressBook displayNameForAddress:addr]];
ms_free(uri);
if (LinphoneManager.runningOnIpad) {
UIHistoryCell *cell = (UIHistoryCell *)[self tableView:tableView cellForRowAtIndexPath:indexPath];
[cell onDetails:self];
} else {
LinphoneAddress *addr = linphone_call_log_get_remote_address(callLog);
char *uri = linphone_address_as_string(addr);
DialerView *view = VIEW(DialerView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
[view call:[NSString stringWithUTF8String:uri]
displayName:[FastAddressBook displayNameForAddress:addr]];
ms_free(uri);
}
}
}
}

View file

@ -64,8 +64,8 @@
self.fullscreen = fullscreen;
self.landscapeMode = YES;
self.portraitMode = YES;
self.isLeftFragment = isLeftFragment || (otherFragment == nil);
self.otherFragment = LinphoneManager.runningOnIpad ? NSStringFromClass(otherFragment) : nil;
self.isLeftFragment = isLeftFragment || (self.otherFragment == nil);
self.darkBackground = true;
return self;
@ -406,9 +406,9 @@
UIViewController *newMainViewController = description.isLeftFragment
? [self getCachedController:description.name]
: [self getCachedController:description.otherFragment];
UIViewController *newDetailsViewController = description.isLeftFragment
? [self getCachedController:description.otherFragment]
: [self getCachedController:description.name];
UIViewController *newDetailsViewController = !description.isLeftFragment
? [self getCachedController:description.name]
: [self getCachedController:description.otherFragment];
UIViewController *newStatusBarViewController = [self getCachedController:description.statusBar];
UIViewController *newTabBarViewController = [self getCachedController:description.tabBar];
UIViewController *newSideMenuViewController = [self getCachedController:description.sideMenu];

View file

@ -39,6 +39,7 @@
UIView *sub = ((UIView *)[arrayOfViews objectAtIndex:0]);
[self setFrame:CGRectMake(0, 0, sub.frame.size.width, sub.frame.size.height)];
[self addSubview:sub];
_detailsButton.hidden = LinphoneManager.runningOnIpad;
callLog = NULL;
}
return self;