Composer update - UI enhancements

- Composer height =58px - Frame = 42px
- Replace current scroll to bottom implementation with a scroll to Bottom FAB on both themes
- The text inside the composer frame should be centered
- The padding between the "reveal plus" button, composer frame and Left + Right sides should be at equal distance on default mode
- Verify that the "Send a message..." String matches with the colour indicated on Figma.
- The padding between each component (buttons and composer frame) should be at equal distance on default mode. E.g : It should be at 12px for each gap.
- The input text jumps down when users start typing. It should be centered at all times.
- Remove the Scroll bar in the text frame.
- DARK THEME
This commit is contained in:
Gil Eluard
2021-03-20 21:31:17 +01:00
parent bdcfc88d6b
commit ea8add1953
25 changed files with 167 additions and 115 deletions
@@ -268,62 +268,6 @@
[self checkHeight:YES];
}
- (void)displayScrollToBottomIcon:(NSUInteger)newMessagesCount onIconTapGesture:(void (^)(void))onIconTapGesture
{
if (newMessagesCount)
{
[self reset];
self.iconImageView.image = [UIImage imageNamed:@"scrolldown"];
self.iconImageView.tintColor = ThemeService.shared.theme.noticeColor;
NSString *notification;
if (newMessagesCount > 1)
{
notification = NSLocalizedStringFromTable(@"room_new_messages_notification", @"Vector", nil);
}
else
{
notification = NSLocalizedStringFromTable(@"room_new_message_notification", @"Vector", nil);
}
self.messageLabel.text = [NSString stringWithFormat:notification, newMessagesCount];
self.messageLabel.textColor = ThemeService.shared.theme.warningColor;
self.messageLabel.hidden = NO;
}
else
{
self.unsentMessagesContentView.hidden = YES;
// We keep the current message if any
[self resetIcon];
self.messageLabel.text = nil;
self.iconImageView.image = [UIImage imageNamed:@"scrolldown"];
self.iconImageView.tintColor = ThemeService.shared.theme.textPrimaryColor;
}
self.iconImageView.hidden = NO;
// Make VoiceOver consider it as a button
self.iconImageView.accessibilityLabel = NSLocalizedStringFromTable(@"room_accessiblity_scroll_to_bottom", @"Vector", nil);
self.iconImageView.isAccessibilityElement = YES;
self.iconImageView.accessibilityTraits = UIAccessibilityTraitButton;
if (onIconTapGesture)
{
objc_setAssociatedObject(self.iconImageView, "onIconTapGesture", [onIconTapGesture copy], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
// Listen to icon tap
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onIconTap:)];
[tapGesture setNumberOfTouchesRequired:1];
[tapGesture setNumberOfTapsRequired:1];
[tapGesture setDelegate:self];
[self.iconImageView addGestureRecognizer:tapGesture];
self.iconImageView.userInteractionEnabled = YES;
}
[self checkHeight:YES];
}
- (void)displayRoomReplacementWithRoomLinkTappedHandler:(void (^)(void))onRoomReplacementLinkTapped
{
[self reset];