diff --git a/Vector/ViewController/RoomViewController.m b/Vector/ViewController/RoomViewController.m index 1116354df..2ad8dd182 100644 --- a/Vector/ViewController/RoomViewController.m +++ b/Vector/ViewController/RoomViewController.m @@ -126,6 +126,12 @@ [self.menuListView addConstraint:heightConstraint]; } [self.view setNeedsUpdateConstraints]; + + if (self.roomDataSource) + { + // this room view controller has its own typing management. + self.roomDataSource.showTypingNotifications = NO; + } } - (void)didReceiveMemoryWarning @@ -458,6 +464,8 @@ // get the room member names NSMutableArray *names = [[NSMutableArray alloc] init]; + // keeps the only the first two users + // for(int i = 0; i < MIN(count, 2); i++) { NSString* name = [currentTypingUsers objectAtIndex:i]; @@ -489,7 +497,7 @@ text = [NSString stringWithFormat:NSLocalizedStringFromTable(@"room_many_users_are_typing", @"Vector", nil), [names objectAtIndex:0], [names objectAtIndex:1]]; } - //((RoomInputToolbarView*)self.inputToolbarView).typingNotifLabel.text = text; + [((RoomExtraInfosInfoView*) self.extraInfoView) updateTypingMessage:text]; } @end diff --git a/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.h b/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.h index d804173be..c015d5fb2 100644 --- a/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.h +++ b/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.h @@ -21,5 +21,14 @@ `RoomExtraInfosInfoView` instance is a view used to display extra information */ @interface RoomExtraInfosInfoView : MXKRoomExtraInfoView + +@property (weak, nonatomic) IBOutlet UIImageView *typingImageView; +@property (weak, nonatomic) IBOutlet UILabel *messageLabel; + @property (weak, nonatomic) IBOutlet NSLayoutConstraint *mainHeightConstraint; + + +// update the displayed typing message. +// nil message hides the typing icon too. +- (void)updateTypingMessage:(NSString*)message; @end diff --git a/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.m b/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.m index 244203eb7..33387d15c 100644 --- a/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.m +++ b/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.m @@ -47,5 +47,28 @@ // Remove default toolbar background color self.backgroundColor = [UIColor whiteColor]; + + // TODO : put this mint grey color as a resource + self.typingImageView.backgroundColor = [UIColor colorWithRed:(98.0/256.0) green:(206.0/256.0) blue:(156.0/256.0) alpha:1.0]; + self.typingImageView.layer.cornerRadius = self.typingImageView.frame.size.height / 2; + } + +// update the displayed typing message. +// nil message hides the typing icon too. +- (void)updateTypingMessage:(NSString*)message +{ + if (message) + { + self.typingImageView.hidden = false; + self.messageLabel.hidden = false; + self.messageLabel.text = message; + } + else + { + self.typingImageView.hidden = true; + self.messageLabel.hidden = true; + } +} + @end diff --git a/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.xib b/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.xib index 319bc3c7f..829eae769 100644 --- a/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.xib +++ b/Vector/Views/RoomExtraInfosInfoView/RoomExtraInfosInfoView.xib @@ -2,7 +2,7 @@ - + @@ -13,8 +13,31 @@ - + + + + + + + + + + + + + + + + @@ -31,7 +54,12 @@ + + + + +