diff --git a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.h b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.h index 4282c505dd..503441a523 100644 --- a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.h +++ b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.h @@ -205,7 +205,7 @@ typedef enum : NSUInteger UIView *messageComposerContainer; @protected - UIView *inputAccessoryView; + UIView *inputAccessoryViewForKeyboard; } /** @@ -333,7 +333,7 @@ typedef enum : NSUInteger actually used to retrieve the keyboard view. Indeed the keyboard view is the superview of the accessory view when the message composer become the first responder. */ -@property (readonly) UIView *inputAccessoryView; +@property (readonly) UIView *inputAccessoryViewForKeyboard; /** Display the keyboard. diff --git a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.m b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.m index 40d0d5356d..61933d8d9a 100644 --- a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.m +++ b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.m @@ -61,7 +61,7 @@ Array of validation views (MXKImageView instances) @end @implementation MXKRoomInputToolbarView -@synthesize messageComposerContainer, inputAccessoryView; +@synthesize messageComposerContainer, inputAccessoryViewForKeyboard; + (UINib *)nib { @@ -103,7 +103,7 @@ - (void)awakeFromNib - (void)dealloc { - inputAccessoryView = nil; + inputAccessoryViewForKeyboard = nil; [self destroy]; } diff --git a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithSimpleTextView.m b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithSimpleTextView.m index 3cdb38eda7..c48bfda5a2 100644 --- a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithSimpleTextView.m +++ b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithSimpleTextView.m @@ -30,8 +30,8 @@ - (void)awakeFromNib [super awakeFromNib]; // Add an accessory view to the text view in order to retrieve keyboard view. - inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero]; - self.messageComposerTextView.inputAccessoryView = self.inputAccessoryView; + inputAccessoryViewForKeyboard = [[UIView alloc] initWithFrame:CGRectZero]; + self.messageComposerTextView.inputAccessoryView = inputAccessoryViewForKeyboard; } -(void)customizeViewRendering diff --git a/Riot/Modules/Room/MXKRoomViewController.m b/Riot/Modules/Room/MXKRoomViewController.m index a3ec8d280b..2002d73444 100644 --- a/Riot/Modules/Room/MXKRoomViewController.m +++ b/Riot/Modules/Room/MXKRoomViewController.m @@ -308,7 +308,9 @@ - (void)viewWillAppear:(BOOL)animated } // Finalize view controller appearance - [self updateViewControllerAppearanceOnRoomDataSourceState]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateViewControllerAppearanceOnRoomDataSourceState]; + }); // no need to reload the tableview at this stage // IOS is going to load it after calling this method @@ -493,7 +495,7 @@ - (void)onKeyboardShowAnimationComplete if (!keyboardView) { // Check whether the first responder is the input tool bar text composer - keyboardView = inputToolbarView.inputAccessoryView.superview; + keyboardView = inputToolbarView.inputAccessoryViewForKeyboard.superview; } // Report the keyboard view in order to track keyboard frame changes diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 99eff65aa6..1c9114ab12 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -353,7 +353,9 @@ - (void)viewDidLoad // Replace the default input toolbar view. // Note: this operation will force the layout of subviews. That is why cell view classes must be registered before. - [self updateRoomInputToolbarViewClassIfNeeded]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateRoomInputToolbarViewClassIfNeeded]; + }); // set extra area [self setRoomActivitiesViewClass:RoomActivitiesView.class]; @@ -4938,7 +4940,9 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)ce { readMarkerTableViewCell = roomBubbleTableViewCell; - [self checkReadMarkerVisibility]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self checkReadMarkerVisibility]; + }); } } } @@ -5678,25 +5682,28 @@ - (void)goBackToLive continueBlock(threadDataSource, YES); }]; } - else if (self.isContextPreview) - { - [RoomPreviewDataSource loadRoomDataSourceWithRoomId:self.roomDataSource.roomId - andMatrixSession:self.mainSession - onComplete:^(RoomPreviewDataSource *roomDataSource) - { - continueBlock(roomDataSource, YES); - }]; - } - else + else if (self.roomDataSource.roomId) { - // Switch back to the room live timeline managed by MXKRoomDataSourceManager - MXKRoomDataSourceManager *roomDataSourceManager = [MXKRoomDataSourceManager sharedManagerForMatrixSession:self.mainSession]; + if (self.isContextPreview) + { + [RoomPreviewDataSource loadRoomDataSourceWithRoomId:self.roomDataSource.roomId + andMatrixSession:self.mainSession + onComplete:^(RoomPreviewDataSource *roomDataSource) + { + continueBlock(roomDataSource, YES); + }]; + } + else + { + // Switch back to the room live timeline managed by MXKRoomDataSourceManager + MXKRoomDataSourceManager *roomDataSourceManager = [MXKRoomDataSourceManager sharedManagerForMatrixSession:self.mainSession]; - [roomDataSourceManager roomDataSourceForRoom:self.roomDataSource.roomId - create:YES - onComplete:^(MXKRoomDataSource *roomDataSource) { - continueBlock(roomDataSource, NO); - }]; + [roomDataSourceManager roomDataSourceForRoom:self.roomDataSource.roomId + create:YES + onComplete:^(MXKRoomDataSource *roomDataSource) { + continueBlock(roomDataSource, NO); + }]; + } } } } diff --git a/Riot/Modules/Room/RoomViewController.xib b/Riot/Modules/Room/RoomViewController.xib index 783146c292..aac9ed79aa 100644 --- a/Riot/Modules/Room/RoomViewController.xib +++ b/Riot/Modules/Room/RoomViewController.xib @@ -1,9 +1,9 @@ - + - + @@ -41,25 +41,14 @@ - - - - - - - - - - + + + + + - - + + @@ -160,8 +149,8 @@ -