Merge branch 'mkirk/group-search' into release/2.27.0

pull/1/head
Michael Kirk 7 years ago
commit 00cde6a034

@ -16,35 +16,27 @@ import SignalServiceKit
init() { init() {
super.init(style: .default, reuseIdentifier: TAG) super.init(style: .default, reuseIdentifier: TAG)
self.contentView.addSubview(avatarView)
let textContainer = UIView.container()
textContainer.addSubview(nameLabel)
textContainer.addSubview(subtitleLabel)
self.contentView.addSubview(textContainer)
// Font config // Font config
nameLabel.font = .ows_dynamicTypeBody nameLabel.font = .ows_dynamicTypeBody
subtitleLabel.font = UIFont.ows_regularFont(withSize: 11.0) subtitleLabel.font = UIFont.ows_regularFont(withSize: 11.0)
subtitleLabel.textColor = UIColor.ows_darkGray subtitleLabel.textColor = UIColor.ows_darkGray
// Listen to notifications...
// TODO avatar, group name change, group membership change, group member name change
// Layout // Layout
nameLabel.autoPinEdgesToSuperviewEdges(with: UIEdgeInsets.zero, excludingEdge: .bottom)
subtitleLabel.autoPinEdgesToSuperviewEdges(with: UIEdgeInsets.zero, excludingEdge: .top)
subtitleLabel.autoPinEdge(.top, to: .bottom, of: nameLabel)
avatarView.autoPinLeadingToSuperviewMargin()
avatarView.autoVCenterInSuperview()
avatarView.autoSetDimension(.width, toSize: CGFloat(kContactCellAvatarSize)) avatarView.autoSetDimension(.width, toSize: CGFloat(kContactCellAvatarSize))
avatarView.autoPinToSquareAspectRatio() avatarView.autoPinToSquareAspectRatio()
textContainer.autoPinEdge(.leading, to: .trailing, of: avatarView, withOffset: kContactCellAvatarTextMargin) let textRows = UIStackView(arrangedSubviews: [nameLabel, subtitleLabel])
textContainer.autoPinTrailingToSuperviewMargin() textRows.axis = .vertical
textContainer.autoVCenterInSuperview() textRows.alignment = .leading
let columns = UIStackView(arrangedSubviews: [avatarView, textRows])
columns.axis = .horizontal
columns.alignment = .center
columns.spacing = kContactCellAvatarTextMargin
self.contentView.addSubview(columns)
columns.autoPinEdgesToSuperviewMargins()
} }
required init?(coder aDecoder: NSCoder) { required init?(coder aDecoder: NSCoder) {

Loading…
Cancel
Save