Tweak contact shares.

pull/1/head
Matthew Chen 7 years ago
parent 3c4d14034b
commit 2b457c6499

@ -11,7 +11,7 @@ extern const CGFloat kContactCellAvatarTextMargin;
@class SignalAccount; @class SignalAccount;
@class TSThread; @class TSThread;
@interface ContactCellView : UIView @interface ContactCellView : UIStackView
@property (nonatomic, nullable) NSString *accessoryMessage; @property (nonatomic, nullable) NSString *accessoryMessage;

@ -84,22 +84,12 @@ const CGFloat kContactCellAvatarTextMargin = 12;
[self.nameContainerView setContentHuggingHorizontalLow]; [self.nameContainerView setContentHuggingHorizontalLow];
[self.accessoryViewContainer setContentHuggingHorizontalHigh]; [self.accessoryViewContainer setContentHuggingHorizontalHigh];
UIStackView *hStackView = [[UIStackView alloc] initWithArrangedSubviews:@[ self.axis = UILayoutConstraintAxisHorizontal;
self.avatarView, self.spacing = kContactCellAvatarTextMargin;
self.nameContainerView, self.alignment = UIStackViewAlignmentCenter;
self.accessoryViewContainer, [self addArrangedSubview:self.avatarView];
]]; [self addArrangedSubview:self.nameContainerView];
hStackView.axis = UILayoutConstraintAxisHorizontal; [self addArrangedSubview:self.accessoryViewContainer];
hStackView.spacing = kContactCellAvatarTextMargin;
hStackView.distribution = UIStackViewDistributionFill;
[self addSubview:hStackView];
[hStackView autoVCenterInSuperview];
[hStackView autoPinEdgeToSuperviewMargin:ALEdgeLeading];
[hStackView autoPinEdgeToSuperviewMargin:ALEdgeTrailing];
// Ensure that the cell's contents never overflow the cell bounds.
[hStackView autoPinEdgeToSuperviewMargin:ALEdgeTop relation:NSLayoutRelationGreaterThanOrEqual];
[hStackView autoPinEdgeToSuperviewMargin:ALEdgeBottom relation:NSLayoutRelationGreaterThanOrEqual];
[self configureFonts]; [self configureFonts];
} }

Loading…
Cancel
Save