From f2e419412bda0d8935eaf291bd8db17edcf64b03 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Wed, 14 Dec 2022 06:54:36 +0100 Subject: [PATCH] Remove meta-information (#690) --- .../MastodonPickServerViewController.swift | 1 - .../PickServer/PickServerSection.swift | 38 ---------------- .../TableViewCell/PickServerCell.swift | 44 ------------------- 3 files changed, 83 deletions(-) diff --git a/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift b/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift index 728290832..6f0fa4a97 100644 --- a/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift +++ b/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift @@ -40,7 +40,6 @@ final class MastodonPickServerViewController: UIViewController, NeedsDependency let tableView: UITableView = { let tableView = ControlContainableTableView() tableView.rowHeight = UITableView.automaticDimension - tableView.separatorStyle = .none tableView.backgroundColor = .clear tableView.keyboardDismissMode = .onDrag tableView.sectionHeaderTopPadding = .leastNonzeroMagnitude diff --git a/Mastodon/Scene/Onboarding/PickServer/PickServerSection.swift b/Mastodon/Scene/Onboarding/PickServer/PickServerSection.swift index 587f512b6..d32b5beb6 100644 --- a/Mastodon/Scene/Onboarding/PickServer/PickServerSection.swift +++ b/Mastodon/Scene/Onboarding/PickServer/PickServerSection.swift @@ -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 .receive(on: DispatchQueue.main) diff --git a/Mastodon/Scene/Onboarding/PickServer/TableViewCell/PickServerCell.swift b/Mastodon/Scene/Onboarding/PickServer/TableViewCell/PickServerCell.swift index 4cbe77b9c..2d8af7b80 100644 --- a/Mastodon/Scene/Onboarding/PickServer/TableViewCell/PickServerCell.swift +++ b/Mastodon/Scene/Onboarding/PickServer/TableViewCell/PickServerCell.swift @@ -53,36 +53,6 @@ class PickServerCell: UITableViewCell { 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 expandConstraints: [NSLayoutConstraint] = [] @@ -131,20 +101,6 @@ extension PickServerCell { containerView.addArrangedSubview(domainLabel) containerView.addArrangedSubview(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) {