Adapt "new group" and "update group" views to RTL.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 693e74e868
commit e2125978de

@ -76,6 +76,7 @@ NS_ASSUME_NONNULL_BEGIN
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
target:self
action:@selector(dismissPressed)];
// TODO:
UIImage *newGroupImage = [UIImage imageNamed:@"btnGroup--white"];
OWSAssert(newGroupImage);
UIBarButtonItem *newGroupButton = [[UIBarButtonItem alloc] initWithImage:newGroupImage

@ -141,7 +141,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
[threadInfoView addSubview:avatarView];
[avatarView autoVCenterInSuperview];
[avatarView autoPinEdgeToSuperviewEdge:ALEdgeLeft];
[avatarView autoPinLeadingToSuperView];
[avatarView autoSetDimension:ALDimensionWidth toSize:kNewGroupViewControllerAvatarWidth];
[avatarView autoSetDimension:ALDimensionHeight toSize:kNewGroupViewControllerAvatarWidth];
[self updateAvatarView];
@ -158,8 +158,8 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
forControlEvents:UIControlEventEditingChanged];
[threadInfoView addSubview:groupNameTextField];
[groupNameTextField autoVCenterInSuperview];
[groupNameTextField autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:avatarView withOffset:16.f];
[groupNameTextField autoPinEdgeToSuperviewEdge:ALEdgeRight withInset:16.f];
[groupNameTextField autoPinTrailingToSuperView];
[groupNameTextField autoPinLeadingToTrailingOfView:avatarView margin:16.f];
[avatarView
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(avatarTouched:)]];

@ -185,7 +185,7 @@ NS_ASSUME_NONNULL_BEGIN
[threadInfoView addSubview:avatarView];
[avatarView autoVCenterInSuperview];
[avatarView autoPinEdgeToSuperviewEdge:ALEdgeLeft];
[avatarView autoPinLeadingToSuperView];
[avatarView autoSetDimension:ALDimensionWidth toSize:kAvatarSize];
[avatarView autoSetDimension:ALDimensionHeight toSize:kAvatarSize];
_groupAvatar = self.thread.groupModel.groupImage;
@ -205,8 +205,8 @@ NS_ASSUME_NONNULL_BEGIN
forControlEvents:UIControlEventEditingChanged];
[threadInfoView addSubview:groupNameTextField];
[groupNameTextField autoVCenterInSuperview];
[groupNameTextField autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:avatarView withOffset:16.f];
[groupNameTextField autoPinEdgeToSuperviewEdge:ALEdgeRight withInset:16.f];
[groupNameTextField autoPinTrailingToSuperView];
[groupNameTextField autoPinLeadingToTrailingOfView:avatarView margin:16.f];
[avatarView
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(avatarTouched:)]];

@ -194,10 +194,11 @@ const NSUInteger kContactTableViewCellAvatarSize = 40;
OWSAssert(self.nameLabel.superview == self.contentView);
const CGFloat kSubtitleVMargin
= ((self.contentView.height - self.nameLabel.font.lineHeight) * 0.5f - self.subtitle.height) * 0.5f;
self.subtitle.frame = CGRectMake(self.nameLabel.left,
round((self.contentView.height - self.subtitle.height) - kSubtitleVMargin),
self.subtitle.width,
self.subtitle.height);
self.subtitle.frame
= CGRectMake((self.isRTL ? round(self.nameLabel.right - self.subtitle.width) : self.nameLabel.left),
round((self.contentView.height - self.subtitle.height) - kSubtitleVMargin),
self.subtitle.width,
self.subtitle.height);
}
}

Loading…
Cancel
Save