mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 08:10:59 +00:00
Visibility icon on expanded posts
This commit is contained in:
parent
6800055ced
commit
4fbda99bb6
1 changed files with 20 additions and 9 deletions
|
@ -16,7 +16,7 @@ final class StatusView: UIView {
|
||||||
let timeLabel = UILabel()
|
let timeLabel = UILabel()
|
||||||
let bodyView = StatusBodyView()
|
let bodyView = StatusBodyView()
|
||||||
let contextParentTimeLabel = UILabel()
|
let contextParentTimeLabel = UILabel()
|
||||||
let timeApplicationDividerLabel = UILabel()
|
let visibilityImageView = UIImageView()
|
||||||
let applicationButton = UIButton(type: .system)
|
let applicationButton = UIButton(type: .system)
|
||||||
let rebloggedByButton = UIButton()
|
let rebloggedByButton = UIButton()
|
||||||
let favoritedByButton = UIButton()
|
let favoritedByButton = UIButton()
|
||||||
|
@ -33,6 +33,8 @@ final class StatusView: UIView {
|
||||||
private let nameAccountContainerStackView = UIStackView()
|
private let nameAccountContainerStackView = UIStackView()
|
||||||
private let nameAccountTimeStackView = UIStackView()
|
private let nameAccountTimeStackView = UIStackView()
|
||||||
private let contextParentTimeApplicationStackView = UIStackView()
|
private let contextParentTimeApplicationStackView = UIStackView()
|
||||||
|
private let timeVisibilityDividerLabel = UILabel()
|
||||||
|
private let visibilityApplicationDividerLabel = UILabel()
|
||||||
private let contextParentTopNameAccountSpacingView = UIView()
|
private let contextParentTopNameAccountSpacingView = UIView()
|
||||||
private let contextParentBottomNameAccountSpacingView = UIView()
|
private let contextParentBottomNameAccountSpacingView = UIView()
|
||||||
private let interactionsDividerView = UIView()
|
private let interactionsDividerView = UIView()
|
||||||
|
@ -173,7 +175,6 @@ private extension StatusView {
|
||||||
mainStackView.addArrangedSubview(nameAccountContainerStackView)
|
mainStackView.addArrangedSubview(nameAccountContainerStackView)
|
||||||
|
|
||||||
mainStackView.addArrangedSubview(bodyView)
|
mainStackView.addArrangedSubview(bodyView)
|
||||||
bodyView.tag = 666
|
|
||||||
|
|
||||||
contextParentTimeLabel.font = .preferredFont(forTextStyle: .footnote)
|
contextParentTimeLabel.font = .preferredFont(forTextStyle: .footnote)
|
||||||
contextParentTimeLabel.adjustsFontForContentSizeCategory = true
|
contextParentTimeLabel.adjustsFontForContentSizeCategory = true
|
||||||
|
@ -181,12 +182,21 @@ private extension StatusView {
|
||||||
contextParentTimeLabel.setContentHuggingPriority(.required, for: .horizontal)
|
contextParentTimeLabel.setContentHuggingPriority(.required, for: .horizontal)
|
||||||
contextParentTimeApplicationStackView.addArrangedSubview(contextParentTimeLabel)
|
contextParentTimeApplicationStackView.addArrangedSubview(contextParentTimeLabel)
|
||||||
|
|
||||||
timeApplicationDividerLabel.font = .preferredFont(forTextStyle: .footnote)
|
for label in [timeVisibilityDividerLabel, visibilityApplicationDividerLabel] {
|
||||||
timeApplicationDividerLabel.adjustsFontForContentSizeCategory = true
|
label.font = .preferredFont(forTextStyle: .footnote)
|
||||||
timeApplicationDividerLabel.textColor = .secondaryLabel
|
label.adjustsFontForContentSizeCategory = true
|
||||||
timeApplicationDividerLabel.text = "•"
|
label.textColor = .secondaryLabel
|
||||||
timeApplicationDividerLabel.setContentHuggingPriority(.required, for: .horizontal)
|
label.text = "•"
|
||||||
contextParentTimeApplicationStackView.addArrangedSubview(timeApplicationDividerLabel)
|
label.setContentHuggingPriority(.required, for: .horizontal)
|
||||||
|
}
|
||||||
|
|
||||||
|
contextParentTimeApplicationStackView.addArrangedSubview(timeVisibilityDividerLabel)
|
||||||
|
|
||||||
|
contextParentTimeApplicationStackView.addArrangedSubview(visibilityImageView)
|
||||||
|
visibilityImageView.contentMode = .scaleAspectFit
|
||||||
|
visibilityImageView.tintColor = .secondaryLabel
|
||||||
|
|
||||||
|
contextParentTimeApplicationStackView.addArrangedSubview(visibilityApplicationDividerLabel)
|
||||||
|
|
||||||
applicationButton.titleLabel?.font = .preferredFont(forTextStyle: .footnote)
|
applicationButton.titleLabel?.font = .preferredFont(forTextStyle: .footnote)
|
||||||
applicationButton.titleLabel?.adjustsFontForContentSizeCategory = true
|
applicationButton.titleLabel?.adjustsFontForContentSizeCategory = true
|
||||||
|
@ -380,7 +390,8 @@ private extension StatusView {
|
||||||
bodyView.viewModel = viewModel
|
bodyView.viewModel = viewModel
|
||||||
|
|
||||||
contextParentTimeLabel.text = viewModel.contextParentTime
|
contextParentTimeLabel.text = viewModel.contextParentTime
|
||||||
timeApplicationDividerLabel.isHidden = viewModel.applicationName == nil
|
visibilityImageView.image = UIImage(systemName: viewModel.visibility.systemImageName)
|
||||||
|
visibilityApplicationDividerLabel.isHidden = viewModel.applicationName == nil
|
||||||
applicationButton.isHidden = viewModel.applicationName == nil
|
applicationButton.isHidden = viewModel.applicationName == nil
|
||||||
applicationButton.setTitle(viewModel.applicationName, for: .normal)
|
applicationButton.setTitle(viewModel.applicationName, for: .normal)
|
||||||
applicationButton.isEnabled = viewModel.applicationURL != nil
|
applicationButton.isEnabled = viewModel.applicationURL != nil
|
||||||
|
|
Loading…
Reference in a new issue