Fix favorites count button changing with when (un)faving

Closes #406
This commit is contained in:
Shadowfacts 2023-07-04 10:25:32 -07:00
parent 8f8e2a2aea
commit bcd487d311
1 changed files with 17 additions and 7 deletions

View File

@ -141,13 +141,23 @@ class ConversationMainStatusCollectionViewCell: UICollectionViewListCell, Status
$0.isPointerInteractionEnabled = true
}
private lazy var actionsCountHStack = UIStackView(arrangedSubviews: [
reblogsCountButton,
favoritesCountButton,
]).configure {
$0.axis = .horizontal
$0.spacing = 8
$0.distribution = .fillProportionally
// using a UIStackView for this does not layout correctly on the first pass
// (everything is shifted slightly to the right for some reason)
// so do it manually, since there are only two subvviews
private lazy var actionsCountHStack = UIView().configure {
reblogsCountButton.translatesAutoresizingMaskIntoConstraints = false
$0.addSubview(reblogsCountButton)
favoritesCountButton.translatesAutoresizingMaskIntoConstraints = false
$0.addSubview(favoritesCountButton)
NSLayoutConstraint.activate([
reblogsCountButton.leadingAnchor.constraint(equalTo: $0.leadingAnchor),
reblogsCountButton.topAnchor.constraint(equalTo: $0.topAnchor),
reblogsCountButton.bottomAnchor.constraint(equalTo: $0.bottomAnchor),
favoritesCountButton.leadingAnchor.constraint(equalTo: reblogsCountButton.trailingAnchor, constant: 8),
favoritesCountButton.topAnchor.constraint(equalTo: $0.topAnchor),
favoritesCountButton.bottomAnchor.constraint(equalTo: $0.bottomAnchor),
favoritesCountButton.trailingAnchor.constraint(equalTo: $0.trailingAnchor),
])
}
private let timestampAndClientLabel = UILabel().configure {