2021-02-23 15:14:10 +01:00
|
|
|
//
|
2022-01-05 08:11:35 +01:00
|
|
|
// OnboardingHeadlineTableViewCell.swift
|
2021-02-23 15:14:10 +01:00
|
|
|
// Mastodon
|
|
|
|
//
|
|
|
|
// Created by BradGao on 2021/2/23.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
2022-01-27 14:23:39 +01:00
|
|
|
import MastodonAsset
|
|
|
|
import MastodonLocalization
|
2021-02-23 15:14:10 +01:00
|
|
|
|
2022-01-05 08:11:35 +01:00
|
|
|
final class OnboardingHeadlineTableViewCell: UITableViewCell {
|
2021-02-23 15:14:10 +01:00
|
|
|
|
|
|
|
let titleLabel: UILabel = {
|
|
|
|
let label = UILabel()
|
2022-01-05 08:11:35 +01:00
|
|
|
label.font = MastodonPickServerViewController.largeTitleFont
|
|
|
|
label.textColor = MastodonPickServerViewController.largeTitleTextColor
|
2021-02-23 15:14:10 +01:00
|
|
|
label.text = L10n.Scene.ServerPicker.title
|
|
|
|
label.adjustsFontForContentSizeCategory = true
|
|
|
|
label.numberOfLines = 0
|
|
|
|
return label
|
|
|
|
}()
|
|
|
|
|
2022-01-04 11:30:21 +01:00
|
|
|
let subTitleLabel: UILabel = {
|
|
|
|
let label = UILabel()
|
2022-01-05 08:11:35 +01:00
|
|
|
label.font = MastodonPickServerViewController.subTitleFont
|
|
|
|
label.textColor = MastodonPickServerViewController.subTitleTextColor
|
2022-03-15 19:31:57 +01:00
|
|
|
label.text = L10n.Scene.ServerPicker.subtitle
|
2022-01-04 11:30:21 +01:00
|
|
|
label.adjustsFontForContentSizeCategory = true
|
|
|
|
label.numberOfLines = 0
|
|
|
|
return label
|
|
|
|
}()
|
|
|
|
|
2021-02-23 15:14:10 +01:00
|
|
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
|
|
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
|
|
|
_init()
|
|
|
|
}
|
|
|
|
|
|
|
|
required init?(coder: NSCoder) {
|
|
|
|
super.init(coder: coder)
|
|
|
|
_init()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-05 08:11:35 +01:00
|
|
|
extension OnboardingHeadlineTableViewCell {
|
2021-02-23 15:14:10 +01:00
|
|
|
|
|
|
|
private func _init() {
|
2021-03-06 05:55:52 +01:00
|
|
|
selectionStyle = .none
|
2022-02-15 11:15:58 +01:00
|
|
|
backgroundColor = Asset.Scene.Onboarding.background.color
|
2021-10-08 12:10:06 +02:00
|
|
|
|
|
|
|
let container = UIStackView()
|
|
|
|
container.axis = .vertical
|
2022-01-04 11:30:21 +01:00
|
|
|
container.spacing = 16
|
2021-10-08 12:10:06 +02:00
|
|
|
container.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
contentView.addSubview(container)
|
2021-02-23 15:14:10 +01:00
|
|
|
NSLayoutConstraint.activate([
|
2021-10-08 12:10:06 +02:00
|
|
|
container.topAnchor.constraint(equalTo: contentView.topAnchor),
|
|
|
|
container.leadingAnchor.constraint(equalTo: contentView.readableContentGuide.leadingAnchor),
|
|
|
|
container.trailingAnchor.constraint(equalTo: contentView.readableContentGuide.trailingAnchor),
|
2022-01-04 11:30:21 +01:00
|
|
|
contentView.bottomAnchor.constraint(equalTo: container.bottomAnchor, constant: 11),
|
2021-02-23 15:14:10 +01:00
|
|
|
])
|
2021-10-08 12:10:06 +02:00
|
|
|
|
|
|
|
container.addArrangedSubview(titleLabel)
|
2022-01-04 11:30:21 +01:00
|
|
|
container.addArrangedSubview(subTitleLabel)
|
2021-10-08 12:10:06 +02:00
|
|
|
}
|
|
|
|
|
2021-02-23 15:14:10 +01:00
|
|
|
}
|