Remove meta-information (#690)
This commit is contained in:
parent
b08d2437d8
commit
f2e419412b
|
@ -40,7 +40,6 @@ final class MastodonPickServerViewController: UIViewController, NeedsDependency
|
||||||
let tableView: UITableView = {
|
let tableView: UITableView = {
|
||||||
let tableView = ControlContainableTableView()
|
let tableView = ControlContainableTableView()
|
||||||
tableView.rowHeight = UITableView.automaticDimension
|
tableView.rowHeight = UITableView.automaticDimension
|
||||||
tableView.separatorStyle = .none
|
|
||||||
tableView.backgroundColor = .clear
|
tableView.backgroundColor = .clear
|
||||||
tableView.keyboardDismissMode = .onDrag
|
tableView.keyboardDismissMode = .onDrag
|
||||||
tableView.sectionHeaderTopPadding = .leastNonzeroMagnitude
|
tableView.sectionHeaderTopPadding = .leastNonzeroMagnitude
|
||||||
|
|
|
@ -63,44 +63,6 @@ extension PickServerSection {
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
}()
|
}()
|
||||||
cell.usersValueLabel.attributedText = {
|
|
||||||
let attributedString = NSMutableAttributedString()
|
|
||||||
let attachment = NSTextAttachment(image: UIImage(systemName: "person.2.fill")!)
|
|
||||||
let attachmentAttributedString = NSAttributedString(attachment: attachment)
|
|
||||||
attributedString.append(attachmentAttributedString)
|
|
||||||
attributedString.append(NSAttributedString(string: " "))
|
|
||||||
|
|
||||||
let paragraphStyle = NSMutableParagraphStyle()
|
|
||||||
paragraphStyle.lineHeightMultiple = 1.12
|
|
||||||
let valueAttributedString = NSAttributedString(
|
|
||||||
string: server.totalUsers.asAbbreviatedCountString(),
|
|
||||||
attributes: [
|
|
||||||
.paragraphStyle: paragraphStyle
|
|
||||||
]
|
|
||||||
)
|
|
||||||
attributedString.append(valueAttributedString)
|
|
||||||
|
|
||||||
return attributedString
|
|
||||||
}()
|
|
||||||
cell.langValueLabel.attributedText = {
|
|
||||||
let attributedString = NSMutableAttributedString()
|
|
||||||
let attachment = NSTextAttachment(image: UIImage(systemName: "text.bubble.fill")!)
|
|
||||||
let attachmentAttributedString = NSAttributedString(attachment: attachment)
|
|
||||||
attributedString.append(attachmentAttributedString)
|
|
||||||
attributedString.append(NSAttributedString(string: " "))
|
|
||||||
|
|
||||||
let paragraphStyle = NSMutableParagraphStyle()
|
|
||||||
paragraphStyle.lineHeightMultiple = 1.12
|
|
||||||
let valueAttributedString = NSAttributedString(
|
|
||||||
string: server.language.uppercased(),
|
|
||||||
attributes: [
|
|
||||||
.paragraphStyle: paragraphStyle
|
|
||||||
]
|
|
||||||
)
|
|
||||||
attributedString.append(valueAttributedString)
|
|
||||||
|
|
||||||
return attributedString
|
|
||||||
}()
|
|
||||||
|
|
||||||
attribute.isLast
|
attribute.isLast
|
||||||
.receive(on: DispatchQueue.main)
|
.receive(on: DispatchQueue.main)
|
||||||
|
|
|
@ -53,36 +53,6 @@ class PickServerCell: UITableViewCell {
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
|
|
||||||
let infoStackView: UIStackView = {
|
|
||||||
let stackView = UIStackView()
|
|
||||||
stackView.axis = .horizontal
|
|
||||||
stackView.spacing = 16
|
|
||||||
return stackView
|
|
||||||
}()
|
|
||||||
|
|
||||||
let separator: UIView = {
|
|
||||||
let view = UIView()
|
|
||||||
view.backgroundColor = Asset.Theme.System.separator.color
|
|
||||||
return view
|
|
||||||
}()
|
|
||||||
|
|
||||||
let langValueLabel: UILabel = {
|
|
||||||
let label = UILabel()
|
|
||||||
label.textColor = Asset.Colors.Label.primary.color
|
|
||||||
label.font = UIFontMetrics(forTextStyle: .caption1).scaledFont(for: .systemFont(ofSize: 12, weight: .regular))
|
|
||||||
label.textAlignment = .center
|
|
||||||
label.adjustsFontForContentSizeCategory = true
|
|
||||||
return label
|
|
||||||
}()
|
|
||||||
|
|
||||||
let usersValueLabel: UILabel = {
|
|
||||||
let label = UILabel()
|
|
||||||
label.textColor = Asset.Colors.Label.primary.color
|
|
||||||
label.font = UIFontMetrics(forTextStyle: .caption1).scaledFont(for: .systemFont(ofSize: 12, weight: .regular))
|
|
||||||
label.adjustsFontForContentSizeCategory = true
|
|
||||||
return label
|
|
||||||
}()
|
|
||||||
|
|
||||||
private var collapseConstraints: [NSLayoutConstraint] = []
|
private var collapseConstraints: [NSLayoutConstraint] = []
|
||||||
private var expandConstraints: [NSLayoutConstraint] = []
|
private var expandConstraints: [NSLayoutConstraint] = []
|
||||||
|
|
||||||
|
@ -131,20 +101,6 @@ extension PickServerCell {
|
||||||
containerView.addArrangedSubview(domainLabel)
|
containerView.addArrangedSubview(domainLabel)
|
||||||
containerView.addArrangedSubview(descriptionLabel)
|
containerView.addArrangedSubview(descriptionLabel)
|
||||||
containerView.setCustomSpacing(6, after: descriptionLabel)
|
containerView.setCustomSpacing(6, after: descriptionLabel)
|
||||||
containerView.addArrangedSubview(infoStackView)
|
|
||||||
|
|
||||||
infoStackView.addArrangedSubview(usersValueLabel)
|
|
||||||
infoStackView.addArrangedSubview(langValueLabel)
|
|
||||||
infoStackView.addArrangedSubview(UIView())
|
|
||||||
|
|
||||||
separator.translatesAutoresizingMaskIntoConstraints = false
|
|
||||||
contentView.addSubview(separator)
|
|
||||||
NSLayoutConstraint.activate([
|
|
||||||
separator.leadingAnchor.constraint(equalTo: contentView.readableContentGuide.leadingAnchor),
|
|
||||||
contentView.readableContentGuide.trailingAnchor.constraint(equalTo: separator.trailingAnchor),
|
|
||||||
separator.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
|
|
||||||
separator.heightAnchor.constraint(equalToConstant: UIView.separatorLineHeight(of: contentView)).priority(.required - 1),
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||||
|
|
Loading…
Reference in New Issue