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 [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
target:self target:self
action:@selector(dismissPressed)]; action:@selector(dismissPressed)];
// TODO:
UIImage *newGroupImage = [UIImage imageNamed:@"btnGroup--white"]; UIImage *newGroupImage = [UIImage imageNamed:@"btnGroup--white"];
OWSAssert(newGroupImage); OWSAssert(newGroupImage);
UIBarButtonItem *newGroupButton = [[UIBarButtonItem alloc] initWithImage:newGroupImage UIBarButtonItem *newGroupButton = [[UIBarButtonItem alloc] initWithImage:newGroupImage

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

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

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

Loading…
Cancel
Save