(IPAD)fix ChatCreateView

This commit is contained in:
Danmei Chen 2019-01-04 15:28:55 +01:00
parent fb42a12d7f
commit 24befe7501
4 changed files with 22 additions and 1 deletions

View file

@ -54,7 +54,16 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self viewUpdateEvent:nil];
if (IPAD)
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(viewUpdateEvent:)
name:kLinphoneChatCreateViewChange
object:nil];
}
- (void)viewUpdateEvent:(NSNotification *)notif {
CGRect frame = _chiffreOptionView.frame;
if (_isGroupChat) {
_nextButton.hidden = FALSE;
@ -95,7 +104,13 @@ static UICompositeViewDescription *compositeDescription = nil;
_tableController.isForEditing = _isForEditing;
_tableController.isGroupChat = _isGroupChat;
_tableController.isEncrypted = _isEncrypted;
[self changeView:ContactsLinphone];
[self changeView:ContactsLinphone];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
if (IPAD)
[NSNotificationCenter.defaultCenter removeObserver:self];
}
#pragma mark - Chat room functions

View file

@ -105,10 +105,14 @@ static UICompositeViewDescription *compositeDescription = nil;
- (IBAction)onAddGroupChatClick:(id)event {
[self newChatCreate:TRUE];
if (IPAD)
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneChatCreateViewChange object:VIEW(ChatConversationCreateView) userInfo:nil];
}
- (IBAction)onAddClick:(id)event {
[self newChatCreate:FALSE];
if (IPAD)
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneChatCreateViewChange object:VIEW(ChatConversationCreateView) userInfo:nil];
}
- (IBAction)onEditionChangeClick:(id)sender {

View file

@ -57,6 +57,7 @@ extern NSString *const kLinphoneCallEncryptionChanged;
extern NSString *const kLinphoneFileTransferSendUpdate;
extern NSString *const kLinphoneFileTransferRecvUpdate;
extern NSString *const kLinphoneQRCodeFound;
extern NSString *const kLinphoneChatCreateViewChange;
typedef enum _NetworkType {
network_none = 0,

View file

@ -77,6 +77,7 @@ NSString *const kLinphoneCallEncryptionChanged = @"LinphoneCallEncryptionChanged
NSString *const kLinphoneFileTransferSendUpdate = @"LinphoneFileTransferSendUpdate";
NSString *const kLinphoneFileTransferRecvUpdate = @"LinphoneFileTransferRecvUpdate";
NSString *const kLinphoneQRCodeFound = @"LinphoneQRCodeFound";
NSString *const kLinphoneChatCreateViewChange = @"LinphoneChatCreateViewChange";
const int kLinphoneAudioVbrCodecDefaultBitrate = 36; /*you can override this from linphonerc or linphonerc-factory*/